aioprometheus.negotiator module¶
- aioprometheus.negotiator.negotiate(accepts_headers: Sequence[str]) Type[aioprometheus.formats.base.IFormatter] ¶
Negotiate a response format by scanning through a list of ACCEPTS headers and selecting the most efficient format.
The formatter returned by this function is used to render a response.
- Parameters
accepts_headers – a list of ACCEPT headers fields extracted from a request.
- Returns
a formatter class to form up the response into the appropriate representation.
- aioprometheus.negotiator.parse_accepts(accept_headers: Sequence[str]) Set[str] ¶
Return a sequence of accepts items in the request headers