http

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const (
	HeaderAccept              = "Accept"
	HeaderAcceptEncoding      = "Accept-Encoding"
	HeaderAllow               = "Allow"
	HeaderAuthorization       = "Authorization"
	HeaderContentDisposition  = "Content-Disposition"
	HeaderContentEncoding     = "Content-Encoding"
	HeaderContentLength       = "Content-Length"
	HeaderContentType         = "Content-Type"
	HeaderCookie              = "Cookie"
	HeaderSetCookie           = "Set-Cookie"
	HeaderIfModifiedSince     = "If-Modified-Since"
	HeaderLastModified        = "Last-Modified"
	HeaderLocation            = "Location"
	HeaderUpgrade             = "Upgrade"
	HeaderVary                = "Vary"
	HeaderWWWAuthenticate     = "WWW-Authenticate"
	HeaderXForwardedHost      = "X-Forwarded-Host"
	HeaderXForwardedFor       = "X-Forwarded-For"
	HeaderXForwardedProto     = "X-Forwarded-Proto"
	HeaderXForwardedProtocol  = "X-Forwarded-Protocol"
	HeaderXForwardedSsl       = "X-Forwarded-Ssl"
	HeaderXUrlScheme          = "X-Url-Scheme"
	HeaderXHTTPMethodOverride = "X-HTTP-Method-Override"
	HeaderXRealIP             = "X-Real-IP"
	HeaderXResponseTime       = "X-Response-Time"
	HeaderXPoweredBy          = "X-Powered-By"
	HeaderXRequestID          = "X-Request-ID"
	HeaderXRequestedWith      = "X-Requested-With"
	HeaderXSessionID          = "X-Session-ID"
	HeaderXTrackingID         = "X-Tracking-ID"
	HeaderXError              = "X-Error"
	HeaderXRuntime            = "X-Runtime"
	HeaderServer              = "Server"
	HeaderTrueClientIP        = "True-Client-Ip"
	HeaderOrigin              = "Origin"
	HeaderXReferer            = "X-Referer"
	HeaderUserAgent           = "User-Agent"

	// Cloudflare
	HeaderCloudflareIPCountry    = "Cf-Ipcountry"
	HeaderCloudflareRay          = "Cf-Ray"
	HeaderCloudflareConnectingIP = "Cf-Connecting-Ip"
	HeaderCloudflareVisitor      = "Cf-Visitor"

	// Access control
	HeaderAccessControlRequestMethod    = "Access-Control-Request-Method"
	HeaderAccessControlRequestHeaders   = "Access-Control-Request-Headers"
	HeaderAccessControlAllowOrigin      = "Access-Control-Allow-Origin"
	HeaderAccessControlAllowMethods     = "Access-Control-Allow-Methods"
	HeaderAccessControlAllowHeaders     = "Access-Control-Allow-Headers"
	HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials"
	HeaderAccessControlExposeHeaders    = "Access-Control-Expose-Headers"
	HeaderAccessControlMaxAge           = "Access-Control-Max-Age"

	// Security
	HeaderStrictTransportSecurity         = "Strict-Transport-Security"
	HeaderXContentTypeOptions             = "X-Content-Type-Options"
	HeaderXXSSProtection                  = "X-XSS-Protection"
	HeaderXFrameOptions                   = "X-Frame-Options"
	HeaderContentSecurityPolicy           = "Content-Security-Policy"
	HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"
	HeaderXCSRFToken                      = "X-CSRF-Token"
	HeaderReferrerPolicy                  = "Referrer-Policy"

	// Telementry
	HeaderTraceParent = "Traceparent"
	HeaderTraceState  = "Tracestate"
)
View Source
const (
	HeaderValueAuthorizationPrefix = "Bearer "
)

Variables

This section is empty.

Functions

func DefaultHTTPTransport added in v0.11.6

func DefaultHTTPTransport() *http.Transport

func DefaultHTTPTransportDialer added in v0.11.6

func DefaultHTTPTransportDialer() *net.Dialer

func NewHTTPClient added in v0.6.0

func NewHTTPClient(opts ...HTTPClientOption) *http.Client

Types

type HTTPClientOption added in v0.6.0

type HTTPClientOption func(*http.Client)

func HTTPClientWithCheckRedirect added in v0.6.0

func HTTPClientWithCheckRedirect(o func(req *http.Request, via []*http.Request) error) HTTPClientOption

func HTTPClientWithDialContext added in v0.6.0

func HTTPClientWithDialContext(o func(ctx context.Context, network, addr string) (net.Conn, error)) HTTPClientOption

func HTTPClientWithDialTLSContext added in v0.6.0

func HTTPClientWithDialTLSContext(o func(ctx context.Context, network, addr string) (net.Conn, error)) HTTPClientOption

func HTTPClientWithDisableCompression added in v0.6.0

func HTTPClientWithDisableCompression(o bool) HTTPClientOption

func HTTPClientWithDisableKeepAlives added in v0.6.0

func HTTPClientWithDisableKeepAlives(o bool) HTTPClientOption

func HTTPClientWithExpectContinueTimeout added in v0.6.0

func HTTPClientWithExpectContinueTimeout(o time.Duration) HTTPClientOption

func HTTPClientWithForceAttemptHTTP2 added in v0.6.0

func HTTPClientWithForceAttemptHTTP2(o bool) HTTPClientOption

func HTTPClientWithGetProxyConnectHeader added in v0.6.0

func HTTPClientWithGetProxyConnectHeader(o func(ctx context.Context, proxyURL *url.URL, target string) (http.Header, error)) HTTPClientOption

func HTTPClientWithIdleConnTimeout added in v0.6.0

func HTTPClientWithIdleConnTimeout(o time.Duration) HTTPClientOption

func HTTPClientWithJar added in v0.6.0

func HTTPClientWithJar(o http.CookieJar) HTTPClientOption

func HTTPClientWithMaxConnsPerHost added in v0.6.0

func HTTPClientWithMaxConnsPerHost(o int) HTTPClientOption

func HTTPClientWithMaxIdleConns added in v0.6.0

func HTTPClientWithMaxIdleConns(o int) HTTPClientOption

func HTTPClientWithMaxIdleConnsPerHost added in v0.6.0

func HTTPClientWithMaxIdleConnsPerHost(o int) HTTPClientOption

func HTTPClientWithMaxResponseHeaderBytes added in v0.6.0

func HTTPClientWithMaxResponseHeaderBytes(o int64) HTTPClientOption

func HTTPClientWithProxy added in v0.6.0

func HTTPClientWithProxy(o func(request *http.Request) (*url.URL, error)) HTTPClientOption

func HTTPClientWithProxyConnectHeader added in v0.6.0

func HTTPClientWithProxyConnectHeader(o http.Header) HTTPClientOption

func HTTPClientWithReadBufferSize added in v0.6.0

func HTTPClientWithReadBufferSize(o int) HTTPClientOption

func HTTPClientWithResponseHeaderTimeout added in v0.6.0

func HTTPClientWithResponseHeaderTimeout(o time.Duration) HTTPClientOption

func HTTPClientWithRoundTripware added in v0.6.0

func HTTPClientWithRoundTripware(l *zap.Logger, roundTripware ...roundtripware.RoundTripware) HTTPClientOption

func HTTPClientWithTLSClientConfig added in v0.6.0

func HTTPClientWithTLSClientConfig(o *tls.Config) HTTPClientOption

func HTTPClientWithTLSHandshakeTimeout added in v0.6.0

func HTTPClientWithTLSHandshakeTimeout(o time.Duration) HTTPClientOption

func HTTPClientWithTLSNextProto added in v0.6.0

func HTTPClientWithTLSNextProto(o map[string]func(authority string, c *tls.Conn) http.RoundTripper) HTTPClientOption

func HTTPClientWithTelemetry added in v0.11.4

func HTTPClientWithTelemetry(opts ...otelhttp.Option) HTTPClientOption

func HTTPClientWithTimeout added in v0.6.0

func HTTPClientWithTimeout(o time.Duration) HTTPClientOption

func HTTPClientWithTransport added in v0.6.0

func HTTPClientWithTransport(o http.RoundTripper) HTTPClientOption

func HTTPClientWithWriteBufferSize added in v0.6.0

func HTTPClientWithWriteBufferSize(o int) HTTPClientOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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