Skip to main content

parse_json_body

Function parse_json_body 

Source
pub fn parse_json_body(body: &str) -> Result<Value, Error>
Expand description

Parses a JSON body string into a serde_json::Value

§Arguments

  • body - JSON string representing the request body

§Examples

use postgrest_parser::parser::parse_json_body;

let body = r#"{"name": "Alice", "age": 30}"#;
let value = parse_json_body(body).unwrap();
assert!(value.is_object());