MCPcopy Index your code
hub / github.com/aws/aws-lambda-rust-runtime / from_str

Function from_str

lambda-http/src/request.rs:528–530  ·  view source on GitHub ↗

Deserializes a `Request` from a string of JSON text. # Example ```rust,no_run use lambda_http::request::from_str; use std::fs::File; use std::error::Error; fn main() -> Result<(), Box > { let request = from_str( r#"{ ...raw json here... }"# )?; Ok(println!("{:#?}", request)) } ```

(s: &str)

Source from the content-addressed store, hash-verified

526/// }
527/// ```
528pub fn from_str(s: &str) -> Result<crate::Request, JsonError> {
529 serde_json::from_str(s).map(LambdaRequest::into)
530}
531
532fn x_forwarded_proto() -> HeaderName {
533 HeaderName::from_static("x-forwarded-proto")

Calls

no outgoing calls