Documentation
¶
Index ¶
Constants ¶
const ( ContentTypeJson = "application/json" ContentTypeTextXml = "text/xml" ContentTypeApplicationXml = "application/xml" ContentTypeText = "text/" ContentTypeBinary = "application/octet-stream" ContentTypeFormData = "multipart/form-data" ContentTypeUrlEncoded = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func Body ¶ added in v1.4.11
Body reads the body of an HTTP request and decodes it into v. You can include the mimetypes that are acceptable, otherwise it will read the body based on the content type. If does not close the body of the request, which should be done by the caller. v can be a io.Writer, in which case the body is copied into it. v can be a struct, in which case the body is decoded into it.
func Query ¶ added in v1.4.11
Query copies the query parameters from a request into a structure, which should be a pointer to a struct. The struct should have json tags. No attempt is made to validate the query parameters beyond the conversion from string or []string into the appropriate type. It can use the MarshalJSON interface to convert a string into a custom type.