Skip to content

Commit

Permalink
Adds an example of a Proxy request (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
Morzaram authored Sep 4, 2024
1 parent fb92cb5 commit 0e61902
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/req.ex
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,21 @@ defmodule Req do
iex> URI.to_string(req.url)
"https://elixir-lang.org"
Performing a request through a proxy with basic authentication:
iex> Req.new(
...> url: "https://www.google.com/",
...> connect_options: [
...> proxy_headers: [{"proxy-authorization", "Basic " <> Base.encode64("user:pass")}]
...> ],
...> proxy: {:http, "your.proxy.com", 8888, []},
...> transport_opts: [
...> # verify: :verify_none,
...> cacertfile: "/your/cert/File.pem"
...> ]
...> )
iex> |> Req.get!()
Fake adapter:
iex> fake = fn request ->
Expand Down

0 comments on commit 0e61902

Please sign in to comment.