Documentation ¶
Overview ¶
ContentType ensures that the "Content-Type" HTTP header is always "application/json" in all responses from the server.
Index ¶
Constants ¶
View Source
const ( // The HTTP header that will be altered HttpContentTypeKey = "Content-Type" // The value that will go in the header HttpContentTypeValue = "application/json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType struct { }
ContentType Struct has no members b/c it's just a way to satisfy the interface that Negroni requires for middleware
func NewContentType ¶
func NewContentType() *ContentType
NewContentType returns a new instance of ContentType
func (*ContentType) ServeHTTP ¶
func (r *ContentType) ServeHTTP(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.