Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f5a0863

Browse filesBrowse files
committed
add method report error
1 parent 10dac35 commit f5a0863
Copy full SHA for f5a0863

File tree

Expand file treeCollapse file tree

2 files changed

+34
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+34
-2
lines changed

‎chapter3/section4/app_with_local_proxy.py

Copy file name to clipboardExpand all lines: chapter3/section4/app_with_local_proxy.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def get_current_user():
15-
15+
print '1'
1616
users = User.query.all()
1717
return random.choice(users)
1818

@@ -64,4 +64,4 @@ def user_view():
6464

6565

6666
if __name__ == '__main__':
67-
app.run(host='0.0.0.0', port=9000)
67+
app.run(host='0.0.0.0', port=5000)

‎errata.md

Copy file name to clipboardExpand all lines: errata.md
+32Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,35 @@
120120
### 正则匹配代理地址问题
121121

122122
感谢 @loveQt 指出。我完成正则匹配代理地址的时候距离现在已经过了半年,有些代理地址不可用,有些解析的姿势不对。具体的可以看 [Issue #10](https://github.com/dongweiming/web_develop/issues/10)。再隔一段时间可能又会变动,所以建议大家学习会方法就好了,具体的实现要对症下药啦。
123+
124+
### 方法语义的说明
125+
126+
感谢 @Pyclearl
127+
128+
在第5章 合理使用请求方法和状态码(P129)的「方法语义的说明」表中:
129+
130+
有这样一段:
131+
132+
```
133+
PUT 用于完整的替换资源或者创建指定身份的资源,比如创建 id 为 123 的某个资源
134+
1. 如果是创建了资源,则返回 201 Created
135+
2. 如果是替换了资源,则返回 200 OK
136+
137+
PATCH 用于局部更新资源
138+
1. 完成请求后返回状态码 200 OK
139+
2. 完成请求后需要返回被修改的资源详细信息
140+
3. 完成请求后需要返回被修改的资源详细信息
141+
```
142+
143+
其中有一句位置不对,应该是这样:
144+
145+
```
146+
PUT 用于完整的替换资源或者创建指定身份的资源,比如创建 id 为 123 的某个资源
147+
1. 如果是创建了资源,则返回 201 Created
148+
2. 如果是替换了资源,则返回 200 OK
149+
3. 完成请求后需要返回被修改的资源详细信息
150+
151+
PATCH 用于局部更新资源
152+
1. 完成请求后返回状态码 200 OK
153+
2. 完成请求后需要返回被修改的资源详细信息
154+
``` ```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.