headers

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package headers defines common HTTP headers.

Index

Constants

View Source
const (
	Accept           = "Accept"            // RFC 2616
	Authorization    = "Authorization"     // RFC 2616
	ContentType      = "Content-Type"      // RFC 2616
	ContentLength    = "Content-Length"    // RFC 2616
	ETag             = "ETag"              // RFC 2616
	TransferEncoding = "Transfer-Encoding" // RFC 2616
)

Commonly used HTTP headers.

View Source
const (
	Forwarded     = "Forwarded"       // RFC 7239
	XForwardedFor = "X-Forwarded-For" // Non-standard
	XFrameOptions = "X-Frame-Options" // Non-standard
)

Commonly used HTTP headers for forwarding originating IP addresses of clients connecting through an reverse proxy or load balancer.

View Source
const (
	ContentTypeBinary    = "application/octet-stream"
	ContentTypeJSON      = "application/json"
	ContentTypeJSONLines = "application/x-ndjson"
	ContentTypeText      = "text/plain"
	ContentTypeHTML      = "text/html"
)

Commonly used HTTP content type values.

Variables

This section is empty.

Functions

func Accepts

func Accepts(h http.Header, s string) bool

Accepts reports whether h contains an "Accept" header that includes s.

Types

This section is empty.

Jump to

Keyboard shortcuts

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