Documentation ¶
Overview ¶
httpx provides extensions for http applications and services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientError ¶
type ClientError struct {
// contains filtered or unexported fields
}
ClientError is a custom error type for errors happening when calling an HTTP endpoint.
func NewClientError ¶
func NewClientError(resp *http.Response) *ClientError
NewClientError creates a new HTTP client error.
func (*ClientError) Error ¶
func (e *ClientError) Error() string
func (*ClientError) StatusCode ¶
func (e *ClientError) StatusCode() int
StatusCode returns the status code of the HTTP response.
type Middleware ¶
type Middleware interface {
Wrap(next http.HandlerFunc) http.HandlerFunc
}
Middleware is an interface for wrapping an HTTP handler function.
type ServerError ¶
type ServerError struct {
// contains filtered or unexported fields
}
ServerError is a custom error type for errors happening in HTTP handlers.
func NewServerError ¶
func NewServerError(err error, statusCode int) *ServerError
NewServerError creates a new HTTP server error.
func (*ServerError) StatusCode ¶
func (e *ServerError) StatusCode() int
StatusCode returns the appropriate HTTP status code for the error.
Click to show internal directories.
Click to hide internal directories.