Categorygithub.com/ynetpkg/chttp
modulepackage
0.0.4
Repository: https://github.com/ynetpkg/chttp.git
Documentation: pkg.go.dev

# Packages

Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
No description provided by the author
Package fcgi implements the FastCGI protocol.
Package http2 implements the HTTP/2 protocol.
Package httptest provides utilities for HTTP testing.
Package httptrace provides mechanisms to trace the events within HTTP client requests.
Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.

# Functions

AllowQuerySemicolons returns a handler that serves requests by converting any unescaped semicolons in the URL query to ampersands, and invoking the handler h.
CanonicalHeaderKey returns the canonical format of the header Key s.
DetectContentType implements the algorithm described at https://mimesniff.spec.whatwg.org/ to determine the Content-Type of the given data.
Error replies to the request with the specified error message and HTTP code.
FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.
FS converts fsys to a FileSystem implementation, for use with FileServer and NewFileTransport.
Get issues a GET to the specified URL.
Handle registers the handler for the given pattern in the DefaultServeMux.
HandleFunc registers the handler function for the given pattern in the DefaultServeMux.
Head issues a HEAD to the specified URL.
ListenAndServe listens on the TCP network address addr and then calls Serve with handler to handle requests on incoming connections.
ListenAndServeTLS acts identically to ListenAndServe, except that it expects HTTPS connections.
MaxBytesHandler returns a Handler that runs h with its ResponseWriter and Request.Body wrapped by a MaxBytesReader.
MaxBytesReader is similar to io.LimitReader but is intended for limiting the size of incoming request bodies.
NewFileTransport returns a new RoundTripper, serving the provided FileSystem.
NewRequest wraps NewRequestWithContext using context.Background.
NewRequestWithContext returns a new Request given a method, URL, and optional body.
NewResponseController creates a ResponseController for a request.
NewServeMux allocates and returns a new ServeMux.
NotFound replies to the request with an HTTP 404 not found error.
NotFoundHandler returns a simple request handler that replies to each request with a “404 page not found” reply.
ParseHTTPVersion parses an HTTP version string according to RFC 7230, section 2.6.
ParseTime parses a time header (such as the Date: header), trying each of the three formats allowed by HTTP/1.1: TimeFormat, time.RFC850, and time.ANSIC.
Post
Post issues a POST to the specified URL.
PostForm issues a POST to the specified URL, with data's keys and values URL-encoded as the request body.
ProxyFromEnvironment returns the URL of the proxy to use for a given request, as indicated by the environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof).
ProxyURL returns a proxy function (for use in a Transport) that always returns the same URL.
ReadRequest reads and parses an incoming request from b.
ReadResponse reads and returns an HTTP response from r.
Redirect replies to the request with a redirect to url, which may be a path relative to the request path.
RedirectHandler returns a request handler that redirects each request it receives to the given url using the given status code.
Serve accepts incoming HTTP connections on the listener l, creating a new service goroutine for each.
ServeContent replies to the request using the content in the provided ReadSeeker.
ServeFile replies to the request with the contents of the named file or directory.
ServeTLS accepts incoming HTTPS connections on the listener l, creating a new service goroutine for each.
SetCookie adds a Set-Cookie header to the provided ResponseWriter's headers.
StatusText returns a text for the HTTP status code.
StripPrefix returns a handler that serves HTTP requests by removing the given prefix from the request URL's Path (and RawPath if set) and invoking the handler h.
TimeoutHandler returns a Handler that runs h with the given time limit.

# Constants

1 MB.
DefaultMaxIdleConnsPerHost is the default value of Transport's MaxIdleConnsPerHost.
HeaderOrderKey is a magic Key for ResponseWriter.Header map keys that, if present, defines a header order that will be used to write the headers onto wire.
Common HTTP methods.
Common HTTP methods.
Common HTTP methods.
Common HTTP methods.
Common HTTP methods.
RFC 5789.
Common HTTP methods.
Common HTTP methods.
Common HTTP methods.
PHeaderOrderKey is a magic Key for setting http2 pseudo header order.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StateActive represents a connection that has read 1 or more bytes of a request.
StateClosed represents a closed connection.
StateHijacked represents a hijacked connection.
StateIdle represents a connection that has finished handling a request and is in the keep-alive state, waiting for a new request.
StateNew represents a new connection that is expected to send a request immediately.
RFC 9110, 15.3.3.
RFC 5842, 7.1.
RFC 9110, 15.6.3.
RFC 9110, 15.5.1.
RFC 9110, 15.5.10.
RFC 9110, 15.2.1.
RFC 9110, 15.3.2.
RFC 8297.
RFC 9110, 15.5.18.
RFC 4918, 11.4.
RFC 9110, 15.5.4.
RFC 9110, 15.4.3.
RFC 9110, 15.6.5.
RFC 9110, 15.5.11.
RFC 9110, 15.6.6.
RFC 3229, 10.4.1.
RFC 4918, 11.5.
RFC 9110, 15.6.1.
RFC 9110, 15.5.12.
RFC 4918, 11.3.
RFC 5842, 7.2.
RFC 9110, 15.5.6.
RFC 9110, 15.5.20.
RFC 9110, 15.4.2.
RFC 9110, 15.4.1.
RFC 4918, 11.1.
RFC 6585, 6.
RFC 9110, 15.3.5.
RFC 9110, 15.3.4.
RFC 9110, 15.5.7.
RFC 2774, 7.
RFC 9110, 15.5.5.
RFC 9110, 15.6.2.
RFC 9110, 15.4.5.
RFC 9110, 15.3.1.
RFC 9110, 15.3.7.
RFC 9110, 15.5.3.
RFC 9110, 15.4.9.
RFC 9110, 15.5.13.
RFC 6585, 3.
RFC 2518, 10.1.
RFC 9110, 15.5.8.
RFC 9110, 15.5.17.
RFC 9110, 15.5.14.
RFC 6585, 5.
RFC 9110, 15.5.9.
RFC 9110, 15.5.15.
RFC 9110, 15.3.6.
RFC 9110, 15.4.4.
RFC 9110, 15.6.4.
RFC 9110, 15.2.2.
RFC 9110, 15.5.19 (Unused).
RFC 9110, 15.4.8.
RFC 8470, 5.2.
RFC 6585, 4.
RFC 9110, 15.5.2.
RFC 7725, 3.
RFC 9110, 15.5.21.
RFC 9110, 15.5.16.
RFC 9110, 15.5.22.
RFC 9110, 15.4.6.
RFC 2295, 8.1.
TimeFormat is the time format to use when generating times in HTTP headers.
TrailerPrefix is a magic prefix for ResponseWriter.Header map keys that, if present, signals that the map entry is actually for the response trailers, and not the response headers.
UnChangedHeaderKey does not require case conversion.

# Variables

DefaultClient is the default Client and is used by Get, Head, and Post.
DefaultServeMux is the default ServeMux used by Serve.
DefaultTransport is the default implementation of Transport and is used by DefaultClient.
ErrAbortHandler is a sentinel panic value to abort a handler.
ErrBodyNotAllowed is returned by ResponseWriter.Write calls when the HTTP method or response code does not permit a body.
ErrBodyReadAfterClose is returned when reading a Request or Response Body after the body has been closed.
ErrContentLength is returned by ResponseWriter.Write calls when a Handler set a Content-Length response header with a declared size and then attempted to write more bytes than declared.
ErrHandlerTimeout is returned on ResponseWriter Write calls in handlers which have timed out.
Deprecated: ErrHeaderTooLong is no longer returned by anything in the net/http package.
ErrHijacked is returned by ResponseWriter.Write calls when the underlying connection has been hijacked using the Hijacker interface.
ErrLineTooLong is returned when reading request or response bodies with malformed chunked encoding.
ErrMissingBoundary is returned by Request.MultipartReader when the request's Content-Type does not include a "boundary" parameter.
Deprecated: ErrMissingContentLength is no longer returned by anything in the net/http package.
ErrMissingFile is returned by FormFile when the provided file field name is either not present in the request or not a file field.
ErrNoCookie is returned by Request's Cookie method when a cookie is not found.
ErrNoLocation is returned by Response's Location method when no Location header is present.
ErrNotMultipart is returned by Request.MultipartReader when the request's Content-Type is not multipart/form-data.
ErrNotSupported indicates that a feature is not supported.
ErrSchemeMismatch is returned when a server returns an HTTP response to an HTTPS client.
ErrServerClosed is returned by the Server's Serve, ServeTLS, ListenAndServe, and ListenAndServeTLS methods after a call to Shutdown or Close.
Deprecated: ErrShortBody is no longer returned by anything in the net/http package.
ErrSkipAltProtocol is a sentinel error value defined by Transport.RegisterProtocol.
Deprecated: ErrUnexpectedTrailer is no longer returned by anything in the net/http package.
ErrUseLastResponse can be returned by Client.CheckRedirect hooks to control how redirects are processed.
Deprecated: ErrWriteAfterFlush is no longer returned by anything in the net/http package.
LocalAddrContextKey is a context key.
NoBody is an io.ReadCloser with no bytes.
ServerContextKey is a context key.

# Structs

A Client is an HTTP client.
A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an HTTP response or the Cookie header of an HTTP request.
No description provided by the author
MaxBytesError is returned by MaxBytesReader when its read limit is exceeded.
ProtocolError represents an HTTP protocol error.
PushOptions describes options for Pusher.Push.
A Request represents an HTTP request received by a server or to be sent by a client.
Response represents the response from an HTTP request.
A ResponseController is used by an HTTP handler to control the response.
ServeMux is an HTTP request multiplexer.
A Server defines parameters for running an HTTP server.
Transport is an implementation of RoundTripper that supports HTTP, HTTPS, and HTTP proxies (for either HTTP or HTTPS with CONNECT).

# Interfaces

The CloseNotifier interface is implemented by ResponseWriters which allow detecting when the underlying connection has gone away.
A CookieJar manages storage and use of cookies in HTTP requests.
A File is returned by a FileSystem's Open method and can be served by the FileServer implementation.
A FileSystem implements access to a collection of named files.
The Flusher interface is implemented by ResponseWriters that allow an HTTP handler to flush buffered data to the client.
A Handler responds to an HTTP request.
The Hijacker interface is implemented by ResponseWriters that allow an HTTP handler to take over the connection.
Pusher is the interface implemented by ResponseWriters that support HTTP/2 server push.
A ResponseWriter interface is used by an HTTP handler to construct an HTTP response.
RoundTripper is an interface representing the ability to execute a single HTTP transaction, obtaining the Response for a given Request.

# Type aliases

A ConnState represents the state of a client connection to a server.
A Dir implements FileSystem using the native file system restricted to a specific directory tree.
The HandlerFunc type is an adapter to allow the use of ordinary functions as HTTP handlers.
A Header represents the Key-value pairs in an HTTP header.
SameSite allows a server to define a cookie attribute making it impossible for the browser to send this cookie along with cross-site requests.