package
2.4.0
Repository: https://github.com/go-ozzo/ozzo-routing.git
Documentation: pkg.go.dev

# Functions

AcceptMediaTypes builds a list of AcceptRange from the given HTTP request.
LanguageNegotiator returns a content language negotiation handler.
NegotiateContentType negotiates the content types based on the given request and allowed types.
ParseAcceptRange parses a single accept string into an AcceptRange.
ParseAcceptRanges parses an Accept header into a list of AcceptRange.
TypeNegotiator returns a content type negotiation handler.

# Constants

MIME types.
MIME types.
Language is the key used to store and retrieve the chosen language in routing.Context.
MIME types.
MIME types.

# Variables

DataWriters lists all supported content types and the corresponding data writers.

# Structs

AcceptRange represents an accept range as defined in https://tools.ietf.org/html/rfc7231#section-5.3.2 Accept = #( media-range [ accept-params ] ) media-range = ( "*/*" / ( type "/" "*" ) / ( type "/" subtype ) ) *( OWS ";" OWS parameter ) accept-params = weight *( accept-ext ) accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ].
HTMLDataWriter sets the "Content-Type" response header as "text/html; charset=UTF-8" and calls routing.DefaultDataWriter to write the given data to the response.
JSONDataWriter sets the "Content-Type" response header as "application/json" and writes the given data in JSON format to the response.
XMLDataWriter sets the "Content-Type" response header as "application/xml; charset=UTF-8" and writes the given data in XML format to the response.