Skip to content

Commit 4a88fe6

Browse files
committed
Correct documentation
send can only take a single event as its argument.
1 parent 936263c commit 4a88fe6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/source/basic-usage.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ And then we can send requests:
238238
client = MyHttpClient("httpbin.org", 443)
239239
240240
client.send(h11.Request(method="GET", target="/xml",
241-
headers=[("Host", "httpbin.org")]),
242-
h11.EndOfMessage())
241+
headers=[("Host", "httpbin.org")]))
242+
client.send(h11.EndOfMessage())
243243
244244
And read back the events:
245245

@@ -321,8 +321,8 @@ allowing us to send another :class:`Request`:
321321
client.conn.our_state, client.conn.their_state
322322
323323
client.send(h11.Request(method="GET", target="/get",
324-
headers=[("Host", "httpbin.org")]),
325-
h11.EndOfMessage())
324+
headers=[("Host", "httpbin.org")]))
325+
client.send(h11.EndOfMessage())
326326
client.next_event()
327327
328328
@@ -339,9 +339,9 @@ Here's some ideas of things you might try:
339339
340340
client.send(h11.Request(method="POST", target="/post",
341341
headers=[("Host", "httpbin.org"),
342-
("Content-Length", "10")]),
343-
h11.Data(data=b"1234567890"),
344-
h11.EndOfMessage())
342+
("Content-Length", "10")]))
343+
client.send(h11.Data(data=b"1234567890"))
344+
client.send(h11.EndOfMessage())
345345
346346
* Experiment with what happens if you try to violate the HTTP protocol
347347
by sending a :class:`Response` as a client, or sending two

0 commit comments

Comments
 (0)