HTTP accept header
A very basic & naive implementation of the HTTP Accept header. It uses http crate and mime crate to parse the accept header. Basic data structure:
Usage:
// parse accept header
let accept: Accept = "application/json, text/html;q=0.9, text/plain;q=0.8, */*;q=0.7"
.parse
.unwrap;
// prepare a list of supported media types
let available = vec!;
// content negotiation
let negotiated = accept.negotiate.unwrap;
// "application/json" shall be chosen since it is available and has the highest weight
assert_eq!;