Versions in this module Expand all Collapse all v0 v0.1.7 May 10, 2023 v0.0.0 May 10, 2023 Changes in this version + const DefaultMaxHeaderBytes + const DefaultMaxIdleConnsPerHost + const MethodConnect + const MethodDelete + const MethodGet + const MethodHead + const MethodOptions + const MethodPatch + const MethodPost + const MethodPut + const MethodTrace + const StatusAccepted + const StatusAlreadyReported + const StatusBadGateway + const StatusBadRequest + const StatusConflict + const StatusContinue + const StatusCreated + const StatusExpectationFailed + const StatusFailedDependency + const StatusForbidden + const StatusFound + const StatusGatewayTimeout + const StatusGone + const StatusHTTPVersionNotSupported + const StatusIMUsed + const StatusInsufficientStorage + const StatusInternalServerError + const StatusLengthRequired + const StatusLocked + const StatusLoopDetected + const StatusMethodNotAllowed + const StatusMovedPermanently + const StatusMultiStatus + const StatusMultipleChoices + const StatusNetworkAuthenticationRequired + const StatusNoContent + const StatusNonAuthoritativeInfo + const StatusNotAcceptable + const StatusNotExtended + const StatusNotFound + const StatusNotImplemented + const StatusNotModified + const StatusOK + const StatusPartialContent + const StatusPaymentRequired + const StatusPermanentRedirect + const StatusPreconditionFailed + const StatusPreconditionRequired + const StatusProcessing + const StatusProxyAuthRequired + const StatusRequestEntityTooLarge + const StatusRequestHeaderFieldsTooLarge + const StatusRequestTimeout + const StatusRequestURITooLong + const StatusRequestedRangeNotSatisfiable + const StatusResetContent + const StatusSeeOther + const StatusServiceUnavailable + const StatusSwitchingProtocols + const StatusTeapot + const StatusTemporaryRedirect + const StatusTooManyRequests + const StatusUnauthorized + const StatusUnavailableForLegalReasons + const StatusUnprocessableEntity + const StatusUnsupportedMediaType + const StatusUpgradeRequired + const StatusUseProxy + const StatusVariantAlsoNegotiates + const TimeFormat + const TrailerPrefix + var DefaultClient = MakeNewClient() + var DefaultServeMux = &defaultServeMux + var ErrAbortHandler = errors.New("net/http: abort Handler") + var ErrBodyNotAllowed = errors.New("http: request method or response status code does not allow body") + var ErrBodyReadAfterClose = errors.New("http: invalid Read on closed Body") + var ErrContentLength = errors.New("http: wrote more than the declared Content-Length") + var ErrHandlerTimeout = errors.New("http: Handler timeout") + var ErrHeaderTooLong = &ProtocolError + var ErrHijacked = errors.New("http: connection has been hijacked") + var ErrLineTooLong = errors.New("header line too long") + var ErrMissingBoundary = &ProtocolError + var ErrMissingContentLength = &ProtocolError + var ErrMissingFile = errors.New("http: no such file") + var ErrNoCookie = errors.New("http: named cookie not present") + var ErrNoLocation = errors.New("http: no Location header in response") + var ErrNotMultipart = &ProtocolError + var ErrNotSupported = &ProtocolError + var ErrServerClosed = errors.New("http: Server closed") + var ErrShortBody = &ProtocolError + var ErrSkipAltProtocol = errors.New("net/http: skip alternate protocol") + var ErrUnexpectedTrailer = &ProtocolError + var ErrUseLastResponse = errors.New("net/http: use last response") + var ErrWriteAfterFlush = errors.New("unused") + var LocalAddrContextKey = &contextKey + var LocalhostCert = []byte(...) + var LocalhostKey = []byte(...) + var NoBody = noBody + var ServerContextKey = &contextKey + func CanonicalHeaderKey(s string) string + func DetectContentType(data []byte) string + func Error(w ResponseWriter, error string, code int) + func FormatHeaderName(s string) string + 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 NewChunkedReader(r io.Reader) io.Reader + func NewChunkedWriter(w io.Writer) io.WriteCloser + 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, urlStr 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 SetCookie(w ResponseWriter, cookie *Cookie) + func StatusText(code int) string + type Client struct + CheckRedirect func(req *Request, res *Response, via []*Request) error + Jar CookieJar + Timeout time.Duration + Transport RoundTripper + UserAgent string + func MakeNewClient() *Client + func (c *Client) Do(req *Request) (resp *Response, err error) + func (c *Client) Get(url string) (r *Response, err error) + func (c *Client) GetWithHost(url, host string) (resp *Response, err error) + func (c *Client) Head(url string) (resp *Response, err error) + func (c *Client) HeadWithHost(url, host string) (resp *Response, err error) + func (c *Client) Post(url string, contentType string, body io.Reader) (resp *Response, err error) + func (c *Client) PostForm(url string, data url.Values) (resp *Response, err error) + type CloseNotifier interface + CloseNotify func() <-chan bool + type ConnState int + const StateActive + const StateClosed + const StateHijacked + const StateIdle + const StateNew + func (c ConnState) String() string + type Cookie struct + Domain string + Expires time.Time + HttpOnly bool + MaxAge int + Name string + Path string + Raw string + RawExpires string + Secure bool + Unparsed []string + Value string + func (c *Cookie) String() string + type CookieJar interface + Cookies func(u *url.URL) []*Cookie + SetCookies func(u *url.URL, cookies []*Cookie) + type Dir string + func (d Dir) Open(name string) (File, error) + type File interface + Readdir func(count int) ([]os.FileInfo, error) + Stat func() (os.FileInfo, error) + type FileSystem interface + Open func(name string) (File, error) + type FlushAfterChunkWriter struct + type Flusher interface + Flush func() + type Handler interface + ServeHTTP func(ResponseWriter, *Request) + func FileServer(root FileSystem) 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 func(ResponseWriter, *Request) + func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request) + type Header map[string][]string + func (h Header) Add(key, value string) + func (h Header) Del(key string) + func (h Header) Get(key string) string + func (h Header) MarshalJSON() ([]byte, error) + func (h Header) Set(key, value string) + func (h Header) Write(w io.Writer) error + func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error + type Hijacker interface + Hijack func() (net.Conn, *bufio.ReadWriter, error) + type PageFingerprint []byte + func (f *PageFingerprint) MarshalJSON() ([]byte, error) + func (f PageFingerprint) Hex() string + type Protocol struct + Major int + Minor int + Name string + type ProtocolError struct + ErrorString string + func (pe *ProtocolError) Error() string + type PushOptions struct + Header Header + Method string + type Pusher interface + Push func(target string, opts *PushOptions) error + type Request struct + Body io.ReadCloser + Cancel <-chan struct{} + Close bool + ContentLength int64 + Form url.Values + GetBody func() (io.ReadCloser, error) + Header Header + Host string + Method string + MultipartForm *multipart.Form + PostForm url.Values + Protocol Protocol + RemoteAddr string + RequestURI string + Response *Response + TLS *tls.ConnectionState + TLSLog *zgrab2.TLSLog + Trailer Header + TransferEncoding []string + URL *url.URL + func NewRequest(method, urlStr string, body io.Reader) (*Request, error) + func NewRequestWithHost(method, urlStr string, host string, body io.Reader) (*Request, error) + func ReadRequest(b *bufio.Reader) (*Request, error) + func (r *Request) AddCookie(c *Cookie) + func (r *Request) BasicAuth() (username, password string, ok bool) + func (r *Request) Context() context.Context + func (r *Request) Cookie(name string) (*Cookie, error) + func (r *Request) Cookies() []*Cookie + func (r *Request) FormFile(key string) (multipart.File, *multipart.FileHeader, error) + func (r *Request) FormValue(key string) string + func (r *Request) MultipartReader() (*multipart.Reader, error) + func (r *Request) ParseForm() error + func (r *Request) ParseMultipartForm(maxMemory int64) error + func (r *Request) PostFormValue(key string) string + func (r *Request) ProtoAtLeast(major, minor int) bool + func (r *Request) Referer() string + func (r *Request) SetBasicAuth(username, password string) + func (r *Request) UserAgent() string + func (r *Request) WithContext(ctx context.Context) *Request + func (r *Request) Write(w io.Writer) error + func (r *Request) WriteProxy(w io.Writer) error + func (request *Request) MarshalJSON() ([]byte, error) + type Response struct + Body io.ReadCloser + BodyHash string + BodySHA256 PageFingerprint + BodyText string + BodyTextLength int64 + Close bool + ContentLength int64 + Header Header + HeadersRaw []byte + Protocol Protocol + Request *Request + Status string + StatusCode int + TLS *tls.ConnectionState + Trailer Header + TransferEncoding []string + Uncompressed bool + func Get(url string) (resp *Response, err error) + func Head(url string) (resp *Response, err error) + func Post(url string, 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) + func ReadResponseTee(tc *TeeConn, req *Request) (*Response, error) + func (r *Response) Cookies() []*Cookie + func (r *Response) Location() (*url.URL, error) + func (r *Response) ProtoAtLeast(major, minor int) bool + func (r *Response) Write(w io.Writer) error + type ResponseWriter interface + Header func() Header + Write func([]byte) (int, error) + WriteHeader func(int) + type RoundTripper interface + RoundTrip func(*Request) (*Response, error) + var DefaultTransport RoundTripper = &Transport{ ... } + func NewFileTransport(fs FileSystem) RoundTripper + type ServeMux struct + func NewServeMux() *ServeMux + func (mux *ServeMux) Handle(pattern string, handler Handler) + func (mux *ServeMux) HandleFunc(pattern string, handler func(ResponseWriter, *Request)) + func (mux *ServeMux) Handler(r *Request) (h Handler, pattern string) + func (mux *ServeMux) ServeHTTP(w ResponseWriter, r *Request) + type Server struct + Addr string + ConnState func(net.Conn, ConnState) + ErrorLog *log.Logger + Handler Handler + IdleTimeout time.Duration + MaxHeaderBytes int + ReadHeaderTimeout time.Duration + ReadTimeout time.Duration + TLSConfig *tls.Config + TLSNextProto map[string]func(*Server, *tls.Conn, Handler) + WriteTimeout time.Duration + func (srv *Server) Close() error + func (srv *Server) ListenAndServe() error + func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error + func (srv *Server) Serve(l net.Listener) error + func (srv *Server) SetKeepAlivesEnabled(v bool) + func (srv *Server) Shutdown(ctx context.Context) error + type TeeConn struct + func (t *TeeConn) BufioReader() *bufio.Reader + func (t *TeeConn) Bytes(s, e int) []byte + func (t *TeeConn) Disable() + func (t *TeeConn) ReadPos() int + type Transport struct + Dial func(network, addr string) (net.Conn, error) + DialContext func(ctx context.Context, network, addr string) (net.Conn, error) + DialTLS func(network, addr string) (net.Conn, error) + DisableCompression bool + DisableKeepAlives bool + ExpectContinueTimeout time.Duration + IdleConnTimeout time.Duration + MaxIdleConns int + MaxIdleConnsPerHost int + MaxResponseHeaderBytes int64 + Proxy func(*Request) (*url.URL, error) + ProxyConnectHeader Header + RawHeaderBuffer bool + ResponseHeaderTimeout time.Duration + TLSClientConfig *tls.Config + TLSHandshakeTimeout time.Duration + TLSNextProto map[string]func(authority string, c *tls.Conn) RoundTripper + func (t *Transport) CancelRequest(req *Request) + func (t *Transport) CloseIdleConnections() + func (t *Transport) RegisterProtocol(scheme string, rt RoundTripper) + func (t *Transport) RoundTrip(req *Request) (*Response, error) + type URLWrapper struct + Fragment string + Host string + Opaque string + Path string + RawPath string + RawQuery string + Scheme string + type UnknownHeader struct + Key string + Values []string