httputil

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalError

func InternalError(req *http.Request, w http.ResponseWriter, err error)

InternalError sends an HTTP 500 with a text/plain message showing the error message It also logs the message.

func NotFound

func NotFound(req *http.Request, w http.ResponseWriter, message string)

NotFound sends an HTTP 404 response with a text/plain message

func RespondWithJSON

func RespondWithJSON(data interface{}, w http.ResponseWriter, req *http.Request)

RespondWithJSON returns a 200 OK with a JSON in the body

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL