Skip to content

Commit

Permalink
add example of HTTP.listen() do request::HTTP.Request
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Jan 18, 2018
1 parent 96fc3b6 commit c8f0ff4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Servers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const nolimit = typemax(Int)


"""
HTTP.listen(host="localhost", port=8081; <keyword arguments>) do http::HTTP.Stream
HTTP.listen(host="localhost", port=8081; <keyword arguments>) do http
...
end
Expand All @@ -257,7 +257,7 @@ Optional keyword arguments:
e.g.
```
HTTP.listen() do http
HTTP.listen() do http::HTTP.Stream
@show http.message
@show header(http, "Content-Type")
while !eof(http)
Expand All @@ -269,6 +269,12 @@ e.g.
write(http, "response body")
write(http, "more response body")
end
HTTP.listen() do request::HTTP.Request
@show header(request, "Content-Type")
@show payload(request)
return HTTP.Response(404)
end
```
"""

Expand Down

0 comments on commit c8f0ff4

Please sign in to comment.