@@ -119,13 +119,15 @@ The client session supports the context manager protocol for self closing.
119
119
forbidden, but you may modify the object in-place if needed.
120
120
121
121
122
- .. coroutinemethod :: request(method, url, *, params=None, data=None,\
123
- headers=None, skip_auto_headers=None, \
124
- auth=None, allow_redirects=True,\
125
- max_redirects=10, encoding='utf-8',\
126
- version=HttpVersion(major=1, minor=1),\
127
- compress=None, chunked=None, expect100=False,\
128
- read_until_eof=True)
122
+ .. comethod :: request(method, url, *, params=None, data=None,\
123
+ headers=None, skip_auto_headers=None, \
124
+ auth=None, allow_redirects=True,\
125
+ max_redirects=10, encoding='utf-8',\
126
+ version=HttpVersion(major=1, minor=1),\
127
+ compress=None, chunked=None, expect100=False,\
128
+ read_until_eof=True)
129
+ :async-with:
130
+ :coroutine:
129
131
130
132
Performs an asynchronous HTTP request. Returns a response object.
131
133
@@ -191,7 +193,9 @@ The client session supports the context manager protocol for self closing.
191
193
:return ClientResponse: a :class: `client response
192
194
<ClientResponse> ` object.
193
195
194
- .. coroutinemethod :: get(url, *, allow_redirects=True, **kwargs)
196
+ .. comethod :: get(url, *, allow_redirects=True, **kwargs)
197
+ :async-with:
198
+ :coroutine:
195
199
196
200
Perform a ``GET `` request.
197
201
@@ -207,7 +211,9 @@ The client session supports the context manager protocol for self closing.
207
211
:return ClientResponse: a :class: `client response
208
212
<ClientResponse> ` object.
209
213
210
- .. coroutinemethod :: post(url, *, data=None, **kwargs)
214
+ .. comethod :: post(url, *, data=None, **kwargs)
215
+ :async-with:
216
+ :coroutine:
211
217
212
218
Perform a ``POST `` request.
213
219
@@ -224,7 +230,9 @@ The client session supports the context manager protocol for self closing.
224
230
:return ClientResponse: a :class: `client response
225
231
<ClientResponse> ` object.
226
232
227
- .. coroutinemethod :: put(url, *, data=None, **kwargs)
233
+ .. comethod :: put(url, *, data=None, **kwargs)
234
+ :async-with:
235
+ :coroutine:
228
236
229
237
Perform a ``PUT `` request.
230
238
@@ -241,7 +249,9 @@ The client session supports the context manager protocol for self closing.
241
249
:return ClientResponse: a :class: `client response
242
250
<ClientResponse> ` object.
243
251
244
- .. coroutinemethod :: delete(url, **kwargs)
252
+ .. comethod :: delete(url, **kwargs)
253
+ :async-with:
254
+ :coroutine:
245
255
246
256
Perform a ``DELETE `` request.
247
257
@@ -254,7 +264,9 @@ The client session supports the context manager protocol for self closing.
254
264
:return ClientResponse: a :class: `client response
255
265
<ClientResponse> ` object.
256
266
257
- .. coroutinemethod :: head(url, *, allow_redirects=False, **kwargs)
267
+ .. comethod :: head(url, *, allow_redirects=False, **kwargs)
268
+ :async-with:
269
+ :coroutine:
258
270
259
271
Perform a ``HEAD `` request.
260
272
@@ -270,7 +282,9 @@ The client session supports the context manager protocol for self closing.
270
282
:return ClientResponse: a :class: `client response
271
283
<ClientResponse> ` object.
272
284
273
- .. coroutinemethod :: options(url, *, allow_redirects=True, **kwargs)
285
+ .. comethod :: options(url, *, allow_redirects=True, **kwargs)
286
+ :async-with:
287
+ :coroutine:
274
288
275
289
Perform an ``OPTIONS `` request.
276
290
@@ -287,7 +301,9 @@ The client session supports the context manager protocol for self closing.
287
301
:return ClientResponse: a :class: `client response
288
302
<ClientResponse> ` object.
289
303
290
- .. coroutinemethod :: patch(url, *, data=None, **kwargs)
304
+ .. comethod :: patch(url, *, data=None, **kwargs)
305
+ :async-with:
306
+ :coroutine:
291
307
292
308
Perform a ``PATCH `` request.
293
309
@@ -304,11 +320,13 @@ The client session supports the context manager protocol for self closing.
304
320
:return ClientResponse: a :class: `client response
305
321
<ClientResponse> ` object.
306
322
307
- .. coroutinemethod :: ws_connect(url, *, protocols=(), timeout=10.0,\
308
- auth=None,\
309
- autoclose=True,\
310
- autoping=True,\
311
- origin=None)
323
+ .. comethod :: ws_connect(url, *, protocols=(), timeout=10.0,\
324
+ auth=None,\
325
+ autoclose=True,\
326
+ autoping=True,\
327
+ origin=None)
328
+ :async-with:
329
+ :coroutine:
312
330
313
331
Create a websocket connection. Returns a
314
332
:class: `ClientWebSocketResponse ` object.
@@ -343,7 +361,7 @@ The client session supports the context manager protocol for self closing.
343
361
344
362
Add *origin * parameter.
345
363
346
- .. coroutinemethod :: close()
364
+ .. comethod :: close()
347
365
348
366
Close underlying connector.
349
367
@@ -715,7 +733,7 @@ BaseConnector
715
733
716
734
.. versionadded :: 0.16
717
735
718
- .. coroutinemethod :: close()
736
+ .. comethod :: close()
719
737
720
738
Close all opened connections.
721
739
@@ -725,7 +743,7 @@ BaseConnector
725
743
returns a future for keeping backward compatibility during
726
744
transition period).
727
745
728
- .. coroutinemethod :: connect(request)
746
+ .. comethod :: connect(request)
729
747
730
748
Get a free connection from pool or create new one if connection
731
749
is absent in the pool.
@@ -739,7 +757,7 @@ BaseConnector
739
757
740
758
:return: :class: `Connection ` object.
741
759
742
- .. coroutinemethod :: _create_connection(req)
760
+ .. comethod :: _create_connection(req)
743
761
744
762
Abstract method for actual connection establishing, should be
745
763
overridden in subclasses.
@@ -1111,7 +1129,7 @@ Response object
1111
1129
1112
1130
For :term: `keep-alive ` support see :meth: `release `.
1113
1131
1114
- .. coroutinemethod :: read()
1132
+ .. comethod :: read()
1115
1133
1116
1134
Read the whole response's body as :class: `bytes `.
1117
1135
@@ -1122,13 +1140,13 @@ Response object
1122
1140
1123
1141
.. seealso :: :meth:`close`, :meth:`release`.
1124
1142
1125
- .. coroutinemethod :: release()
1143
+ .. comethod :: release()
1126
1144
1127
1145
Finish response processing, release underlying connection and
1128
1146
return it into free connection pool for re-usage by next upcoming
1129
1147
request.
1130
1148
1131
- .. coroutinemethod :: text(encoding=None)
1149
+ .. comethod :: text(encoding=None)
1132
1150
1133
1151
Read response's body and return decoded :class: `str ` using
1134
1152
specified *encoding * parameter.
@@ -1146,7 +1164,7 @@ Response object
1146
1164
1147
1165
:return str: decoded *BODY *
1148
1166
1149
- .. coroutinemethod :: json(encoding=None, loads=json.loads)
1167
+ .. comethod :: json(encoding=None, loads=json.loads)
1150
1168
1151
1169
Read response's body as *JSON *, return :class: `dict ` using
1152
1170
specified *encoding * and *loader *.
@@ -1222,7 +1240,7 @@ manually.
1222
1240
:raise TypeError: if data is not :class: `bytes `,
1223
1241
:class: `bytearray ` or :class: `memoryview `.
1224
1242
1225
- .. coroutinemethod :: close(*, code=1000, message=b'')
1243
+ .. comethod :: close(*, code=1000, message=b'')
1226
1244
1227
1245
A :ref: `coroutine<coroutine> ` that initiates closing handshake by sending
1228
1246
:const: `~aiohttp.websocket.MSG_CLOSE ` message. It waits for
@@ -1235,7 +1253,7 @@ manually.
1235
1253
:class: `str ` (converted to *UTF-8 * encoded bytes)
1236
1254
or :class: `bytes `.
1237
1255
1238
- .. coroutinemethod :: receive()
1256
+ .. comethod :: receive()
1239
1257
1240
1258
A :ref: `coroutine<coroutine> ` that waits upcoming *data *
1241
1259
message from peer and returns it.
0 commit comments