http

package
v2.129.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MethodDelete is an alias of http.MethodDelete.
	MethodDelete = http.MethodDelete

	// MethodGet is an alias of http.MethodGet.
	MethodGet = http.MethodGet

	// MethodPatch is an alias of http.MethodPatch.
	MethodPatch = http.MethodPatch

	// MethodPost is an alias of http.MethodPost.
	MethodPost = http.MethodPost

	// MethodPut is an alias of http.MethodPut.
	MethodPut = http.MethodPut

	// StatusBadRequest is an alias of http.StatusBadRequest.
	StatusBadRequest = http.StatusBadRequest

	// StatusConflict is an alias of http.StatusConflict.
	StatusConflict = http.StatusConflict

	// StatusForbidden is an alias of http.StatusForbidden.
	StatusForbidden = http.StatusForbidden

	// StatusGatewayTimeout is an alias of http.StatusGatewayTimeout.
	StatusGatewayTimeout = http.StatusGatewayTimeout

	// StatusOK is an alias of http.StatusOK.
	StatusOK = http.StatusOK

	// StatusInternalServerError is an alias of http.StatusInternalServerError.
	StatusInternalServerError = http.StatusInternalServerError

	// StatusNotFound is an alias of http.StatusNotFound.
	StatusNotFound = http.StatusNotFound

	// StatusNotImplemented is an alias of http.StatusNotImplemented.
	StatusNotImplemented = http.StatusNotImplemented

	// StatusServiceUnavailable is an alias of http.StatusServiceUnavailable.
	StatusServiceUnavailable = http.StatusServiceUnavailable

	// StatusTooManyRequests is an alias of http.StatusTooManyRequests.
	StatusTooManyRequests = http.StatusTooManyRequests

	// StatusUnauthorized is an alias of http.StatusUnauthorized.
	StatusUnauthorized = http.StatusUnauthorized
)

Variables

View Source
var (
	// DefaultTransport is an alias for http.DefaultTransport.
	DefaultTransport = http.DefaultTransport

	// ErrUseLastResponse is an alias for http.ErrUseLastResponse.
	ErrUseLastResponse = http.ErrUseLastResponse

	// ErrServerClosed is an alias for http.ErrServerClosed.
	ErrServerClosed = http.ErrServerClosed

	// NoBody is an alias for http.NoBody.
	NoBody = http.NoBody
)

Functions

func Path added in v2.27.0

func Path(req *http.Request) string

Path will strip / from the start.

func Pattern added in v2.61.0

func Pattern(name env.Name, pattern string) string

Pattern will create a pattern with the format /name/pattern.

func Protocols

func Protocols() *http.Protocols

Protocols returns all the protocols supported.

func StatusText added in v2.21.0

func StatusText(code int) string

StatusText is an alias for http.StatusText.

func Transport

func Transport(cfg *tls.Config) *http.Transport

Transport for HTTP.

Types

type Client added in v2.21.0

type Client = http.Client

Client is an alias for http.Client.

type Handler added in v2.8.0

type Handler = http.Handler

Handler is an alias for http.Handler.

type HandlerFunc added in v2.22.0

type HandlerFunc = http.HandlerFunc

HandlerFunc is an alias for http.HandlerFunc.

type Header = http.Header

Header is an alias for http.Header.

type Request added in v2.21.0

type Request = http.Request

Request is an alias for http.Request.

func NewRequestWithContext added in v2.21.0

func NewRequestWithContext(ctx context.Context, method, url string, body io.Reader) (*Request, error)

NewRequestWithContext is an alias for http.NewRequestWithContext.

type Response added in v2.21.0

type Response = http.Response

Response is an alias for http.Response.

type ResponseWriter added in v2.22.0

type ResponseWriter = http.ResponseWriter

ResponseWriter is an alias for http.ResponseWriter.

type RoundTripper added in v2.21.0

type RoundTripper = http.RoundTripper

RoundTripper is an alias for http.RoundTripper.

type ServeMux added in v2.5.0

type ServeMux = http.ServeMux

ServeMux is an alias for http.ServeMux.

func NewServeMux added in v2.7.0

func NewServeMux() *ServeMux

NewServeMux is an alias for http.NewServeMux.

type Server

type Server = http.Server

Server is an alias for http.Server.

func NewServer

func NewServer(timeout time.Duration, handler Handler) *Server

NewServer for http.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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