func ResolveContentType(req *http.Request) string
Get the content type. e.g. From "multipart/form-data; boundary=--" to "multipart/form-data" If none is specified, returns "text/html" by default.
func ResolveFormat(req *http.Request) string
Resolve the accept request header.
type AcceptLanguage struct { Language string Quality float32 }
A single language from the Accept-Language HTTP header.
type AcceptLanguages []AcceptLanguage
A collection of sortable AcceptLanguage instances.
func ResolveAcceptLanguage(req *http.Request) AcceptLanguages
Resolve the Accept-Language header value.
The results are sorted using the quality defined in the header for each language range with the most qualified language range as the first element in the slice.
See the HTTP header fields specification (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4) for more details.
func (al AcceptLanguages) Len() int
func (al AcceptLanguages) Less(i, j int) bool
func (al AcceptLanguages) String() string
func (al AcceptLanguages) Swap(i, j int)
type Request struct { *http.Request ContentType string Format string // "html", "xml", "json", or "txt" AcceptLanguages AcceptLanguages Locale string Websocket *websocket.Conn }
func NewRequest(r *http.Request) *Request
type Response struct { Status int ContentType string Out http.ResponseWriter }
func NewResponse(w http.ResponseWriter) *Response
func (resp *Response) WriteHeader(defaultStatusCode int, defaultContentType string)
Write the header (for now, just the status code). The status may be set directly by the application (c.Response.Status = 501). if it isn't, then fall back to the provided status code.