clienterror

package
v0.0.0-...-3d9cc79 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: MIT Imports: 3 Imported by: 4

Documentation

Overview

HTTP 4xx Client Error responses from RFC 7231, Section 6.5

Index

Constants

This section is empty.

Variables

View Source
var (
	BadRequestStatus          = msg.Status{400, "Bad Request"}
	UnauthorizedStatus        = msg.Status{401, "Unauthorized"}
	ForbiddenStatus           = msg.Status{403, "Forbidden"}
	NotFoundStatus            = msg.Status{404, "Not Found"}
	MethodNotAllowedStatus    = msg.Status{405, "Method Not Allowed"}
	ConflictStatus            = msg.Status{409, "Conflict"}
	PreconditionFailedStatus  = msg.Status{412, "Precondition Failed"}
	RangeNotSatisfiableStatus = msg.Status{416, "Range Not Satisfiable"}
)

Functions

func MethodNotAllowed

func MethodNotAllowed(supportedMethods ...string) *methodNotAllowed

func RespondMethodNotAllowed

func RespondMethodNotAllowed(client io.Writer, allowedMethods []string)

func RespondNotFound

func RespondNotFound(client io.Writer, path string)

Types

type BadRequest

type BadRequest struct {
	DisplayText string
}

func (*BadRequest) WriteHeader

func (badRequest *BadRequest) WriteHeader(client io.Writer) error

func (*BadRequest) WriteTo

func (badRequest *BadRequest) WriteTo(client io.Writer) error

Jump to

Keyboard shortcuts

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