Documentation ¶
Index ¶
- Constants
- Variables
- func CanonicalHeaderKey(s string) string
- func DetectContentType(data []byte) string
- func Error(w ResponseWriter, error string, code int)
- func Handle(pattern string, handler Handler)
- func HandleFunc(pattern string, handler func(ResponseWriter, *Request))
- func ListenAndServe(addr string, handler Handler) error
- func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error
- func MaxBytesReader(w ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser
- func NotFound(w ResponseWriter, r *Request)
- func ParseHTTPVersion(vers string) (major, minor int, ok bool)
- func ParseTime(text string) (t time.Time, err error)
- func ProxyFromEnvironment(req *Request) (*url.URL, error)
- func ProxyURL(fixedURL *url.URL) func(*Request) (*url.URL, error)
- func Redirect(w ResponseWriter, r *Request, url string, code int)
- func Serve(l net.Listener, handler Handler) error
- func ServeContent(w ResponseWriter, req *Request, name string, modtime time.Time, ...)
- func ServeFile(w ResponseWriter, r *Request, name string)
- func ServeTLS(l net.Listener, handler Handler, certFile, keyFile string) error
- func SetCookie(w ResponseWriter, cookie *Cookie)
- func StatusText(code int) string
- type Client
- func (c *Client) CloseIdleConnections()
- func (c *Client) Do(req *Request) (resp *Response, err error)
- func (c *Client) Get(url string) (resp *Response, err error)
- func (c *Client) GetOriginHttpClient() realHttp.Client
- func (c *Client) Head(url string) (resp *Response, err error)
- func (c *Client) Post(url, contentType string, body io.Reader) (resp *Response, err error)
- func (c *Client) PostForm(url string, data url.Values) (resp *Response, err error)
- type CloseNotifier
- type ConnState
- type Cookie
- type CookieJar
- type Dir
- type File
- type FileSystem
- type Flusher
- type Handler
- func AllowQuerySemicolons(h Handler) Handler
- func FileServer(root FileSystem) Handler
- func MaxBytesHandler(h Handler, n int64) Handler
- func NotFoundHandler() Handler
- func RedirectHandler(url string, code int) Handler
- func StripPrefix(prefix string, h Handler) Handler
- func TimeoutHandler(h Handler, dt time.Duration, msg string) Handler
- type HandlerFunc
- type Header
- type Hijacker
- type MaxBytesError
- type ProtocolError
- type PushOptions
- type Pusher
- type Request
- type Response
- func Get(url string) (resp *Response, err error)
- func Head(url string) (resp *Response, err error)
- func Post(url, contentType string, body io.Reader) (resp *Response, err error)
- func PostForm(url string, data url.Values) (resp *Response, err error)
- func ReadResponse(r *bufio.Reader, req *Request) (*Response, error)
- type ResponseWriter
- type RoundTripper
- type SameSite
- type ServeMux
- type Server
- type Transport
Constants ¶
View Source
const DefaultMaxHeaderBytes = realHttp.DefaultMaxHeaderBytes
View Source
const DefaultMaxIdleConnsPerHost = realHttp.DefaultMaxIdleConnsPerHost
View Source
const MethodConnect = realHttp.MethodConnect
View Source
const MethodDelete = realHttp.MethodDelete
View Source
const MethodGet = realHttp.MethodGet
View Source
const MethodHead = realHttp.MethodHead
View Source
const MethodOptions = realHttp.MethodOptions
View Source
const MethodPatch = realHttp.MethodPatch
View Source
const MethodPost = realHttp.MethodPost
View Source
const MethodPut = realHttp.MethodPut
View Source
const MethodTrace = realHttp.MethodTrace
View Source
const SameSiteDefaultMode = realHttp.SameSiteDefaultMode
View Source
const SameSiteLaxMode = realHttp.SameSiteLaxMode
View Source
const SameSiteNoneMode = realHttp.SameSiteNoneMode
View Source
const SameSiteStrictMode = realHttp.SameSiteStrictMode
View Source
const StateActive = realHttp.StateActive
View Source
const StateClosed = realHttp.StateClosed
View Source
const StateHijacked = realHttp.StateHijacked
View Source
const StateIdle = realHttp.StateIdle
View Source
const StateNew = realHttp.StateNew
View Source
const StatusAccepted = realHttp.StatusAccepted
View Source
const StatusAlreadyReported = realHttp.StatusAlreadyReported
View Source
const StatusBadGateway = realHttp.StatusBadGateway
View Source
const StatusBadRequest = realHttp.StatusBadRequest
View Source
const StatusConflict = realHttp.StatusConflict
View Source
const StatusContinue = realHttp.StatusContinue
View Source
const StatusCreated = realHttp.StatusCreated
View Source
const StatusEarlyHints = realHttp.StatusEarlyHints
View Source
const StatusExpectationFailed = realHttp.StatusExpectationFailed
View Source
const StatusFailedDependency = realHttp.StatusFailedDependency
View Source
const StatusForbidden = realHttp.StatusForbidden
View Source
const StatusFound = realHttp.StatusFound
View Source
const StatusGatewayTimeout = realHttp.StatusGatewayTimeout
View Source
const StatusGone = realHttp.StatusGone
View Source
const StatusHTTPVersionNotSupported = realHttp.StatusHTTPVersionNotSupported
View Source
const StatusIMUsed = realHttp.StatusIMUsed
View Source
const StatusInsufficientStorage = realHttp.StatusInsufficientStorage
View Source
const StatusInternalServerError = realHttp.StatusInternalServerError
View Source
const StatusLengthRequired = realHttp.StatusLengthRequired
View Source
const StatusLocked = realHttp.StatusLocked
View Source
const StatusLoopDetected = realHttp.StatusLoopDetected
View Source
const StatusMethodNotAllowed = realHttp.StatusMethodNotAllowed
View Source
const StatusMisdirectedRequest = realHttp.StatusMisdirectedRequest
View Source
const StatusMovedPermanently = realHttp.StatusMovedPermanently
View Source
const StatusMultiStatus = realHttp.StatusMultiStatus
View Source
const StatusMultipleChoices = realHttp.StatusMultipleChoices
View Source
const StatusNetworkAuthenticationRequired = realHttp.StatusNetworkAuthenticationRequired
View Source
const StatusNoContent = realHttp.StatusNoContent
View Source
const StatusNonAuthoritativeInfo = realHttp.StatusNonAuthoritativeInfo
View Source
const StatusNotAcceptable = realHttp.StatusNotAcceptable
View Source
const StatusNotExtended = realHttp.StatusNotExtended
View Source
const StatusNotFound = realHttp.StatusNotFound
View Source
const StatusNotImplemented = realHttp.StatusNotImplemented
View Source
const StatusNotModified = realHttp.StatusNotModified
View Source
const StatusOK = realHttp.StatusOK
View Source
const StatusPartialContent = realHttp.StatusPartialContent
View Source
const StatusPaymentRequired = realHttp.StatusPaymentRequired
View Source
const StatusPermanentRedirect = realHttp.StatusPermanentRedirect
View Source
const StatusPreconditionFailed = realHttp.StatusPreconditionFailed
View Source
const StatusPreconditionRequired = realHttp.StatusPreconditionRequired
View Source
const StatusProcessing = realHttp.StatusProcessing
View Source
const StatusProxyAuthRequired = realHttp.StatusProxyAuthRequired
View Source
const StatusRequestEntityTooLarge = realHttp.StatusRequestEntityTooLarge
View Source
const StatusRequestHeaderFieldsTooLarge = realHttp.StatusRequestHeaderFieldsTooLarge
View Source
const StatusRequestTimeout = realHttp.StatusRequestTimeout
View Source
const StatusRequestURITooLong = realHttp.StatusRequestURITooLong
View Source
const StatusRequestedRangeNotSatisfiable = realHttp.StatusRequestedRangeNotSatisfiable
View Source
const StatusResetContent = realHttp.StatusResetContent
View Source
const StatusSeeOther = realHttp.StatusSeeOther
View Source
const StatusSwitchingProtocols = realHttp.StatusSwitchingProtocols
View Source
const StatusTeapot = realHttp.StatusTeapot
View Source
const StatusTemporaryRedirect = realHttp.StatusTemporaryRedirect
View Source
const StatusTooEarly = realHttp.StatusTooEarly
View Source
const StatusTooManyRequests = realHttp.StatusTooManyRequests
View Source
const StatusUnprocessableEntity = realHttp.StatusUnprocessableEntity
View Source
const StatusUnsupportedMediaType = realHttp.StatusUnsupportedMediaType
View Source
const StatusUpgradeRequired = realHttp.StatusUpgradeRequired
View Source
const StatusUseProxy = realHttp.StatusUseProxy
View Source
const StatusVariantAlsoNegotiates = realHttp.StatusVariantAlsoNegotiates
View Source
const TimeFormat = realHttp.TimeFormat
View Source
const TrailerPrefix = realHttp.TrailerPrefix
Variables ¶
View Source
var DefaultClient = &Client{}
View Source
var DefaultServeMux = realHttp.DefaultServeMux
View Source
var DefaultTransport = realHttp.DefaultTransport
View Source
var ErrAbortHandler = realHttp.ErrAbortHandler
View Source
var ErrBodyNotAllowed = realHttp.ErrBodyNotAllowed
View Source
var ErrBodyReadAfterClose = realHttp.ErrBodyReadAfterClose
View Source
var ErrContentLength = realHttp.ErrContentLength
View Source
var ErrHandlerTimeout = realHttp.ErrHandlerTimeout
View Source
var ErrHeaderTooLong = realHttp.ErrHeaderTooLong
View Source
var ErrHijacked = realHttp.ErrHijacked
View Source
var ErrLineTooLong = realHttp.ErrLineTooLong
View Source
var ErrMissingBoundary = realHttp.ErrMissingBoundary
View Source
var ErrMissingContentLength = realHttp.ErrMissingContentLength
View Source
var ErrMissingFile = realHttp.ErrMissingFile
View Source
var ErrNoCookie = realHttp.ErrNoCookie
View Source
var ErrNoLocation = realHttp.ErrNoLocation
View Source
var ErrNotMultipart = realHttp.ErrNotMultipart
View Source
var ErrNotSupported = realHttp.ErrNotSupported
View Source
var ErrServerClosed = realHttp.ErrServerClosed
View Source
var ErrShortBody = realHttp.ErrShortBody
View Source
var ErrSkipAltProtocol = realHttp.ErrSkipAltProtocol
View Source
var ErrUnexpectedTrailer = realHttp.ErrUnexpectedTrailer
View Source
var ErrUseLastResponse = realHttp.ErrUseLastResponse
View Source
var ErrWriteAfterFlush = realHttp.ErrWriteAfterFlush
View Source
var LocalAddrContextKey = realHttp.LocalAddrContextKey
View Source
var NoBody = realHttp.NoBody
View Source
var ServerContextKey = realHttp.ServerContextKey
Functions ¶
func CanonicalHeaderKey ¶
func DetectContentType ¶
func Error ¶
func Error(w ResponseWriter, error string, code int)
func HandleFunc ¶
func HandleFunc(pattern string, handler func(ResponseWriter, *Request))
func ListenAndServe ¶
func ListenAndServeTLS ¶
func MaxBytesReader ¶
func MaxBytesReader(w ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser
func NotFound ¶
func NotFound(w ResponseWriter, r *Request)
func ParseHTTPVersion ¶
func ServeContent ¶
func ServeContent(w ResponseWriter, req *Request, name string, modtime time.Time, content io.ReadSeeker)
func ServeFile ¶
func ServeFile(w ResponseWriter, r *Request, name string)
func SetCookie ¶
func SetCookie(w ResponseWriter, cookie *Cookie)
func StatusText ¶
Types ¶
type Client ¶
type Client struct { Transport RoundTripper CheckRedirect func(req *Request, via []*Request) error Jar CookieJar Timeout time.Duration // contains filtered or unexported fields }
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
func (*Client) GetOriginHttpClient ¶ added in v1.18.9
type CloseNotifier ¶
type CloseNotifier = realHttp.CloseNotifier
type Handler ¶
func AllowQuerySemicolons ¶
func FileServer ¶
func FileServer(root FileSystem) Handler
func MaxBytesHandler ¶
func NotFoundHandler ¶
func NotFoundHandler() Handler
func RedirectHandler ¶
func StripPrefix ¶
type HandlerFunc ¶
type HandlerFunc = realHttp.HandlerFunc
type MaxBytesError ¶ added in v1.19.0
type MaxBytesError = realHttp.MaxBytesError
type ProtocolError ¶
type ProtocolError = realHttp.ProtocolError
type PushOptions ¶
type PushOptions = realHttp.PushOptions
type Request ¶
func NewRequestWithContext ¶
type ResponseWriter ¶
type ResponseWriter = realHttp.ResponseWriter
type RoundTripper ¶
type RoundTripper = realHttp.RoundTripper
func NewFileTransport ¶
func NewFileTransport(fs FileSystem) RoundTripper
Click to show internal directories.
Click to hide internal directories.