Req.decode
You're seeing just the function
decode
, go back to Req module for more information.
Decodes response body based on the detected format.
Supported formats:
Format | Decoder |
---|---|
json | Jason.decode!/1 |
gzip | :zlib.gunzip/1 |
tar | :erl_tar.extract/2 |
zip | :zip.unzip/2 |
csv | NimbleCSV.RFC4180.parse_string/2 (if NimbleCSV is installed) |
Examples
iex> Req.get!("https://hex.pm/api/packages/finch").body["meta"]
%{
"description" => "An HTTP client focused on performance.",
"licenses" => ["MIT"],
"links" => %{"GitHub" => "https://github.com/keathley/finch"},
...
}