Skip to content

Commit

Permalink
Merge pull request #24 from w3c/fix-response-example
Browse files Browse the repository at this point in the history
Seems this example doesn't work without the status
  • Loading branch information
jgraham committed May 14, 2014
2 parents a12fb45 + 5ab3214 commit 795fab6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ write a similar response but with more explicit control as follows::

def handler(request, response):
response.add_required_headers = False # Don't implicitly add HTTP headers
response.writer.write_status(200)
response.writer.write_header("Content-Type", "text/plain")
response.writer.write_header("Content-Length", len("Some example content"))
response.writer.end_headers()
response.writer.write("Some ")
time.sleep(1)
Expand Down

0 comments on commit 795fab6

Please sign in to comment.