func UnavailableForLegalReasons(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusUnavailableForLegalReasons, response)
}
UnavailableForLegalReasons writes a response with status code 451.
package jsonhttp
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)
var (
	DefaultContentTypeHeader = "application/json; charset=utf-8"
	EscapeHTML = false
)
type StatusResponse struct {
	Message string `json:"message,omitempty"`
	Code    int    `json:"code,omitempty"`
}
func Respond(w http.ResponseWriter, statusCode int, response interface{}) {
	if statusCode == 0 {
		statusCode = http.StatusOK
	}
	if response == nil {
		response = &StatusResponse{
			Message: http.StatusText(statusCode),
			Code:    statusCode,
		}
	} else {
		switch message := response.(type) {
		case string:
			response = &StatusResponse{
				Message: message,
				Code:    statusCode,
			}
		case error:
			response = &StatusResponse{
				Message: message.Error(),
				Code:    statusCode,
			}
		case interface {
			String() string
		}:
			response = &StatusResponse{
				Message: message.String(),
				Code:    statusCode,
			}
		}
	}
	var b bytes.Buffer
	enc := json.NewEncoder(&b)
	enc.SetEscapeHTML(EscapeHTML)
	if err := enc.Encode(response); err != nil {
		panic(err)
	}
	if DefaultContentTypeHeader != "" {
		w.Header().Set("Content-Type", DefaultContentTypeHeader)
	}
	w.WriteHeader(statusCode)
	fmt.Fprintln(w, b.String())
}
func Continue(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusContinue, response)
}
func SwitchingProtocols(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusSwitchingProtocols, response)
}
func OK(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusOK, response)
}
func Created(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusCreated, response)
}
func Accepted(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusAccepted, response)
}
func NonAuthoritativeInfo(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusNonAuthoritativeInfo, response)
}
func NoContent(w http.ResponseWriter) {
	Respond(w, http.StatusNoContent, nil)
}
func ResetContent(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusResetContent, response)
}
func PartialContent(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusPartialContent, response)
}
func MultipleChoices(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusMultipleChoices, response)
}
func MovedPermanently(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusMovedPermanently, response)
}
func Found(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusFound, response)
}
func SeeOther(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusSeeOther, response)
}
func NotModified(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusNotModified, response)
}
func UseProxy(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusUseProxy, response)
}
func TemporaryRedirect(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusTemporaryRedirect, response)
}
func PermanentRedirect(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusPermanentRedirect, response)
}
func BadRequest(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusBadRequest, response)
}
func Unauthorized(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusUnauthorized, response)
}
func PaymentRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusPaymentRequired, response)
}
func Forbidden(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusForbidden, response)
}
func NotFound(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusNotFound, response)
}
func MethodNotAllowed(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusMethodNotAllowed, response)
}
func NotAcceptable(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusNotAcceptable, response)
}
func ProxyAuthRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusProxyAuthRequired, response)
}
func RequestTimeout(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusRequestTimeout, response)
}
func Conflict(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusConflict, response)
}
func Gone(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusGone, response)
}
func LengthRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusLengthRequired, response)
}
func PreconditionFailed(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusPreconditionFailed, response)
}
func RequestEntityTooLarge(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusRequestEntityTooLarge, response)
}
func RequestURITooLong(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusRequestURITooLong, response)
}
func UnsupportedMediaType(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusUnsupportedMediaType, response)
}
func RequestedRangeNotSatisfiable(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusRequestedRangeNotSatisfiable, response)
}
func ExpectationFailed(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusExpectationFailed, response)
}
func Teapot(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusTeapot, response)
}
func UpgradeRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusUpgradeRequired, response)
}
func PreconditionRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusPreconditionRequired, response)
}
func TooManyRequests(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusTooManyRequests, response)
}
func RequestHeaderFieldsTooLarge(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusRequestHeaderFieldsTooLarge, response)
}