Skip to content

Commit

Permalink
Merge pull request #995 from a8t/main
Browse files Browse the repository at this point in the history
Improve docs regarding Req
  • Loading branch information
bernardd authored Sep 25, 2023
2 parents 1b2324c + 35fb0ba commit 955275c
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions lib/ex_aws/request/http_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ defmodule ExAws.Request.HttpClient do
## Example
Here for example is the code required to make HTTPotion comply with this spec.
Here is an example using [Req](https://hexdocs.pm/req/readme.html).
In your config you would do:
First, create a module implementing the `ExAws.Request.HttpClient` behaviour.
```
config :ex_aws,
http_client: ExAws.Request.Req
defmodule ExAws.Request.Req do
@behaviour ExAws.Request.HttpClient
def request(method, url, body, headers, _http_opts) do
Req.request(method: method, url: url, body: body, headers: headers)
end
end
defmodule ExAws.Request.Req do
@behaviour ExAws.Request.HttpClient
def request(method, url, body, headers, _http_opts) do
Req.request(method: method, url: url, body: body, headers: headers)
end
end
```
Then, in build-time config (e.g. config.exs):
```
config :ex_aws,
http_client: ExAws.Request.Req
```
When conforming your selected HTTP Client take note of a few things:
Expand Down

0 comments on commit 955275c

Please sign in to comment.