package json
import "miniflux.app/http/response/json"
Index ¶
- func BadRequest(w http.ResponseWriter, r *http.Request, err error)
- func Created(w http.ResponseWriter, r *http.Request, body interface{})
- func Forbidden(w http.ResponseWriter, r *http.Request)
- func NoContent(w http.ResponseWriter, r *http.Request)
- func NotFound(w http.ResponseWriter, r *http.Request)
- func OK(w http.ResponseWriter, r *http.Request, body interface{})
- func ServerError(w http.ResponseWriter, r *http.Request, err error)
- func Unauthorized(w http.ResponseWriter, r *http.Request)
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, r *http.Request, err error)
BadRequest sends a bad request error to the client.
func Created ¶
func Created(w http.ResponseWriter, r *http.Request, body interface{})
Created sends a created response to the client.
func Forbidden ¶
func Forbidden(w http.ResponseWriter, r *http.Request)
Forbidden sends a forbidden error to the client.
func NoContent ¶
func NoContent(w http.ResponseWriter, r *http.Request)
NoContent sends a no content response to the client.
func NotFound ¶
func NotFound(w http.ResponseWriter, r *http.Request)
NotFound sends a page not found error to the client.
func OK ¶
func OK(w http.ResponseWriter, r *http.Request, body interface{})
OK creates a new JSON response with a 200 status code.
func ServerError ¶
func ServerError(w http.ResponseWriter, r *http.Request, err error)
ServerError sends an internal error to the client.
func Unauthorized ¶
func Unauthorized(w http.ResponseWriter, r *http.Request)
Unauthorized sends a not authorized error to the client.
Source Files ¶
json.go
- Version
- v1.0.46 (latest)
- Published
- Jul 22, 2023
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 week ago –
Tools for package owners.