Function lambda_http::request::from_reader
source · pub fn from_reader<R>(rdr: R) -> Result<Request, JsonError>where
R: Read,
Expand description
Deserializes a Request
from a Read
impl providing JSON events.
Example
use lambda_http::request::from_reader;
use std::fs::File;
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
let request = from_reader(
File::open("path/to/request.json")?
)?;
Ok(println!("{:#?}", request))
}