Skip to content

Commit

Permalink
Add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed May 24, 2024
1 parent 8fa73e4 commit d8cff15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/req.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ defmodule Req do
iex> Enum.map(resp.body, & &1["id"])
[0, 1]
See `:into` option in `Req.new/1` documentation for more information on response body streaming.
## Header Names
The HTTP specification requires that header names should be case-insensitive.
Expand Down Expand Up @@ -258,6 +260,12 @@ defmodule Req do
`Enumerable` that receives and automatically parses messages. See module documentation
for example usage.
If the request is sent using HTTP/1, an extra process is spawned to consume messages
from the underlying socket. On both HTTP/1 and HTTP/2 the messages are sent to the
current process as soon as they arrive, as a firehose. If you wish to maximize request
rate or have more control over how messages are streamed, use `into: fun` or
`into: collectable` instead.
Response redirect options ([`redirect`](`Req.Steps.redirect/1`) step):
* `:redirect` - if set to `false`, disables automatic response redirects. Defaults to `true`.
Expand Down
7 changes: 6 additions & 1 deletion lib/req/response_async.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ defmodule Req.Response.Async do
This struct implements the `Enumerale` protocol where each element is a body chunk received
from the current process mailbox. HTTP Trailer fields are ignored.
**Note:** this feature is currently experimental and it may change in future releases.
If the request is sent using HTTP/11, an extra process is spawned to consume messages from the
underlying socket. The messages are sent to the current process as soon as they arrive, as a
firehose. If you wish to maximize request rate or have more control over how messages are
streamed, use `into: fun` or `into: collectable` instead.
**Note:** This feature is currently experimental and it may change in future releases.
## Examples
Expand Down

0 comments on commit d8cff15

Please sign in to comment.