Req adapter powered by Rust wreq.
attach/2— set adapter and merge optionsimpersonate/2— set browser profile
Summary
Functions
Attaches CloakedReq adapter behavior to an existing Req.Request.
Sets the impersonation profile and configures the CloakedReq Req adapter.
Functions
@spec attach( Req.Request.t(), keyword() ) :: Req.Request.t()
Attaches CloakedReq adapter behavior to an existing Req.Request.
Supported custom adapter options:
:cookie_jar-%CloakedReq.CookieJar{}for automatic cookie persistence:impersonate- profile atom (e.g.:chrome_136,:"safari_17.4.1"):insecure_skip_verify- boolean:local_address- outbound source IP as string, IPv4 tuple, or IPv6 tuple:max_body_size- positive integer or:unlimited(default: 10 MB)
Examples
iex> req = Req.new(url: "https://example.com") |> CloakedReq.attach(impersonate: :chrome_136)
iex> is_function(req.adapter, 1)
true
iex> Req.Request.get_option(req, :impersonate)
:chrome_136
@spec impersonate(Req.Request.t(), atom()) :: Req.Request.t()
Sets the impersonation profile and configures the CloakedReq Req adapter.
Examples
iex> req = Req.new(url: "https://example.com") |> CloakedReq.impersonate(:chrome_136)
iex> Req.Request.get_option(req, :impersonate)
:chrome_136
iex> is_function(req.adapter, 1)
true