Documentation
¶
Index ¶
Constants ¶
View Source
const (
ErrInvalidContentTypeField = "Content-Type"
)
Variables ¶
View Source
var ( ErrCodeNilRequest string ErrCodeInvalidContentType string ErrCodeInvalidBodyType string )
View Source
var ( ErrNilDecoder = errors.New("decoder is nil") ErrNilRequest = errors.New("request cannot be nil") ErrInvalidContentType = errors.New("invalid content type, expected application/json") ErrInvalidBodyType = errors.New("invalid body type, expected struct") ErrInvalidInstance = errors.New("invalid instance provided to create a reader") )
Functions ¶
func CheckContentType ¶ added in v0.12.2
CheckContentType checks if the content type is JSON
Parameters:
- r: The HTTP request
Returns:
- bool: True if the content type is JSON, false otherwise
Types ¶
Click to show internal directories.
Click to hide internal directories.