sofie-http 0.4.0

The HTTP server, areas, routes and the handler model.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! An app without forms reads JSON only.

use serde_json::{Map, Value};
use sofie_core::{Error, Result};

pub(crate) fn parse(_body: &[u8]) -> Result<Map<String, Value>> {
    Err(Error::BadRequest(
        "this app reads JSON request bodies only".to_owned(),
    ))
}

#[cfg(feature = "idempotency")]
pub(crate) fn posted(_body: &[u8], _name: &str) -> Option<String> {
    None
}