Skip to content

Commit 793de2c

Browse files
committed
Update p01_interact_with_http_services_as_client.rst
处理未翻译,混杂在code里的部分
1 parent 7f3847b commit 793de2c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

source/c11/p01_interact_with_http_services_as_client.rst

+10-5
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,18 @@
114114
content_type = resp.headers['content-type']
115115
content_length = resp.headers['content-length']
116116
117-
Here is a requests example that executes a login into the Python Package index using
118-
basic authentication:
117+
下面是一个利用requests通过基本认证登录Pypi的例子:
118+
119+
.. code-block:: python
120+
119121
import requests
120122
121123
resp = requests.get('http://pypi.python.org/pypi?:action=login',
122124
auth=('user','password'))
123125
124-
Here is an example of using requests to pass HTTP cookies from one request to the
125-
next:
126+
下面是一个利用requests将HTTP cookies从一个请求传递到另一个的例子:
127+
128+
.. code-block:: python
126129
127130
import requests
128131
@@ -133,7 +136,9 @@
133136
# Second requests with cookies received on first requests
134137
resp2 = requests.get(url, cookies=resp1.cookies)
135138
136-
Last, but not least, here is an example of using requests to upload content:
139+
最后但并非最不重要的一个例子是用requests上传内容:
140+
141+
.. code-block:: python
137142
138143
import requests
139144
url = 'http://httpbin.org/post'

0 commit comments

Comments
 (0)