headers

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: BSD-3-Clause Imports: 0 Imported by: 2

Documentation

Overview

Package headers provides constants for well-known HTTP headers.

Index

Constants

View Source
const (
	// Message body
	ContentEncoding  = "Content-Encoding"
	ContentLength    = "Content-Length"
	ContentType      = "Content-Type"
	TransferEncoding = "Transfer-Encoding"

	// Authentication
	Authorization   = "Authorization"
	WWWAuthenticate = "Www-Authenticate"

	// Caching
	Age               = "Age"
	CacheControl      = "Cache-Control"
	ETag              = "Etag"
	Expires           = "Expires"
	IfMatch           = "If-Match"
	IfModifiedSince   = "If-Modified-Since"
	IfNoneMatch       = "If-None-Match"
	IfUnmodifiedSince = "If-Unmodified-Since"
	LastModified      = "Last-Modified"
	Vary              = "Vary"

	// Content negotiation
	Accept         = "Accept"
	AcceptCharset  = "Accept-Charset"
	AcceptEncoding = "Accept-Encoding"
	AcceptLanguage = "Accept-Language"

	// Downloads
	ContentDisposition = "Content-Disposition"

	// Errors
	Allow      = "Allow"
	RetryAfter = "Retry-After"

	// Proxies
	XForwardedFor   = "X-Forwarded-For"
	XForwardedHost  = "X-Forwarded-Host"
	XForwardedProto = "X-Forwarded-Proto"

	// Redirects
	Location = "Location"

	// Range requests
	AcceptRanges = "Accept-Ranges"
	Range        = "Range"
	IfRange      = "If-Range"
	ContentRange = "Content-Range"
)

HTTP header constants, all in canonical format.

View Source
const (
	XContentTypeOptions = "X-Content-Type-Options"
	NoSniff             = "nosniff"
)

X-Content-Type-Options header and its value. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options

View Source
const (
	Connection = "Connection"
	KeepAlive  = "Keep-Alive"
	Expect     = "Expect"

	// ConnectionClose is the value for the Connection header to indicate the
	// sender would like to close the connection.
	ConnectionClose = "close"
)

Connection management headers.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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