Converts a Req.Request into the metadata map and body expected by the Rust NIF.
Validates and normalizes all adapter options (impersonate, timeouts, proxy,
body size, TLS verification). The metadata map is passed to CloakedReq.Native;
the body is passed as a raw binary.
Summary
Functions
Builds a native payload tuple from a Req.Request.
Functions
@spec to_native_payload(Req.Request.t()) :: {:ok, {map(), binary() | nil}} | {:error, CloakedReq.Error.t()}
Builds a native payload tuple from a Req.Request.
Validates the request (URL scheme, body encoding, adapter options) and returns
{:ok, {metadata_map, body_binary}} or {:error, %CloakedReq.Error{}}.