PhoenixApiToolkit.CacheBodyReader.get_raw_request_body

You're seeing just the function get_raw_request_body, go back to PhoenixApiToolkit.CacheBodyReader module for more information.
Link to this function

get_raw_request_body(conn)

View Source

Specs

get_raw_request_body(Plug.Conn.t()) :: binary() | nil

Return the raw request body, after it is cached in the conn by cache_and_read_body/2. Note that the raw request body is not a string!

Examples

use Plug.Test
import PhoenixApiToolkit.CacheBodyReader
import PhoenixApiToolkit.TestHelpers

iex> {:ok, _, conn} = conn(:get, "/hello") |> put_raw_body("the rawness") |> cache_and_read_body()
iex> raw_body = conn |> get_raw_request_body()
["the rawness"]
iex> is_binary(raw_body)
false
iex> to_string(raw_body)
"the rawness"