Function jsonrpsee_core::http_helpers::read_body
source · pub async fn read_body(
headers: &HeaderMap,
body: Body,
max_request_body_size: u32
) -> Result<(Vec<u8>, bool), GenericTransportError<Error>>
Available on crate feature
http-helpers
only.Expand description
Read a data from a hyper::Body
and return the data if it is valid and within the allowed size range.
Returns Ok((bytes, single))
if the body was in valid size range; and a bool indicating whether the JSON-RPC
request is a single or a batch.
Returns Err
if the body was too large or the body couldn’t be read.