Documentation
¶
Overview ¶
Package json contains helper methods to handler requests and responses more easily.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadRequest ¶
ReadRequest validates the request headers and decodes into the provided payload.
func ValidateAcceptHeader ¶
ValidateAcceptHeader checks that the accept header instruction allows for JSON handling.
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, status int, payload interface{}) error
WriteResponse validates the request headers and encodes the provided payload into the response.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.