pub fn accepts_json(headers: &HeaderMap, lenient: bool) -> boolAvailable on crate feature
server only.Expand description
The default reading of the Content-Type rule.
The HTTP header: Content-Type SHALL be set to
application/jsonfor any request that contains a message body.
application/json; charset=utf-8 is accepted, because it says the same thing and is extremely
common. lenient additionally accepts an absent or unrelated type, for a peer that cannot be
persuaded to set it.