goheader

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 1 Imported by: 0

README ΒΆ

Goheader

Goheader is a Go package designed to simplify the management of HTTP headers in web applications. It offers a comprehensive collection of constants, each representing a standard HTTP header field, facilitating easy reference and usage. The package introduces a Header struct that encapsulates vital information about headers, such as name, values, and applicability, streamlining header manipulation. GoHeader provides a set of convenient functions for creating headers, allowing developers to specify multiple values efficiently. Headers are categorized based on their relevance to HTTP requests and responses, enhancing clarity in their usage context. With support for experimental headers and well-documented usage examples, GoHeader helps developers quickly integrate custom headers into their applications.

Goheader

PkgGoDev Go Report Card GitHub release (latest by date) GitHub Contributor Covenant

Features

🏷️ Comprehensive List

GoHeader provides a comprehensive list of constants for standard HTTP headers, making it easy to reference and use common headers in your applications.

πŸ“‚ Header Definition

Provides a Header struct that encapsulates important information about HTTP headers, including name, values, and applicability properties.

πŸ“¦ Header Constructors

Offers helper functions like NewHeaders, NewAIMHeader, NewAcceptHeader, and many more, allowing developers to create headers with specified values efficiently.

Installation

You can install it in your Go project using go get:

go get github.com/lindsaygelle/goheader

Usage

Import the package into your Go code:

import (
	"github.com/lindsaygelle/goheader"
)

Functions

Provided functions for goheader.

NewAIMHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAIMHeader("feed")
	fmt.Println(header)
}
NewAcceptHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptHeader("text/html")
	fmt.Println(header)
}
NewAcceptCHHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptCHHeader("width")
	fmt.Println(header)
}
NewAcceptCHLifetimeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptCHLifetimeHeader("86400")
	fmt.Println(header)
}
NewAcceptCharsetHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptCharsetHeader("UTF-8")
	fmt.Println(header)
}
NewAcceptDatetimeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptDatetimeHeader("Thu, 31 May 2007 20:35:00 GMT")
	fmt.Println(header)
}
NewAcceptEncodingHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptEncodingHeader("gzip")
	fmt.Println(header)
}
NewAcceptLanguageHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptLanguageHeader("en-AU")
	fmt.Println(header)
}
NewAcceptPatchHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptPatchHeader("application/example", "text/example")
	fmt.Println(header)
}
NewAcceptPostHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptPostHeader("application/example", "text/example")
	fmt.Println(header)
}
NewAcceptRangesHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAcceptRangesHeader("bytes")
	fmt.Println(header)
}
NewAccessControlAllowCredentialsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlAllowCredentialsHeader("true")
	fmt.Println(header)
}
NewAccessControlAllowHeadersHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlAllowHeadersHeader("*")
	fmt.Println(header)
}
NewAccessControlAllowMethodsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlAllowMethodsHeader("POST", "GET")
	fmt.Println(header)
}
NewAccessControlAllowOriginHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlAllowOriginHeader("*")
	fmt.Println(header)
}
NewAccessControlExposeHeadersHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlExposeHeadersHeader("https://github.com")
	fmt.Println(header)
}
NewAccessControlMaxAgeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlMaxAgeHeader("600")
	fmt.Println(header)
}
NewAccessControlRequestHeadersHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlRequestHeadersHeader("Content-Type", "X-User-Addr")
	fmt.Println(header)
}
NewAccessControlRequestMethodHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAccessControlRequestMethodHeader("GET")
	fmt.Println(header)
}
NewAgeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAgeHeader("15")
	fmt.Println(header)
}
NewAllowHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAllowHeader("HEAD", "GET")
	fmt.Println(header)
}
NewAltSvcHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAltSvcHeader("h2=\"alt.example.com:443\"", "h2=\":443\"")
	fmt.Println(header)
}
NewAltUsedHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAltUsedHeader("alternate.example.net")
	fmt.Println(header)
}
NewAuthorizationHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewAuthorizationHeader("Basic RXhhbXBsZTphaQ==")
	fmt.Println(header)
}
NewCacheControlHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewCacheControlHeader("max-age=604800")
	fmt.Println(header)
}
NewClearSiteDataHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewClearSiteDataHeader("*")
	fmt.Println(header)
}
NewConnectionHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewConnectionHeader("keep-alive")
	fmt.Println(header)
}
NewContentDPRHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentDPRHeader("1")
	fmt.Println(header)
}
NewContentDispositionHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentDispositionHeader("attachment; filename=\"document.doc\"")
	fmt.Println(header)
}
NewContentEncodingHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentEncodingHeader("deflate", "br")
	fmt.Println(header)
}
NewContentLanguageHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentLanguageHeader("en-AU")
	fmt.Println(header)
}
NewContentLengthHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentLengthHeader("128")
	fmt.Println(header)
}
NewContentLocationHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentLocationHeader("https://example.com/documents/foo")
	fmt.Println(header)
}
NewContentMD5Header
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentMD5Header("b89f948e98f3a113dc13fdbd3bdb17ef")
	fmt.Println(header)
}
NewContentRangeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentRangeHeader("1000-2000/*")
	fmt.Println(header)
}
NewContentSecurityPolicyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentSecurityPolicyHeader("default-src 'self'; font-src fonts.gstatic.com; style-src 'self' fonts.googleapis.com")
	fmt.Println(header)
}
NewContentSecurityPolicyReportOnlyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentSecurityPolicyReportOnlyHeader("default-src https:; report-to /csp-violation-report-endpoint/")
	fmt.Println(header)
}
NewContentTypeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewContentTypeHeader("text/html; charset=utf-8")
	fmt.Println(header)
}
NewCookieHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewCookieHeader("PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1")
	fmt.Println(header)
}
NewCorrelationIDHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewCorrelationIDHeader("93dba609-c615-4513-b95b-0d3468ec20d0")
	fmt.Println(header)
}
NewCriticalCHHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewCriticalCHHeader("Sec-CH-Prefers-Reduced-Motion")
	fmt.Println(header)
}
NewCrossOriginEmbedderPolicyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewCrossOriginEmbedderPolicyHeader("require-corp")
	fmt.Println(header)
}
NewCrossOriginOpenerPolicyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewCrossOriginOpenerPolicyHeader("same-origin-allow-popups")
	fmt.Println(header)
}
NewCrossOriginResourcePolicyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewCrossOriginResourcePolicyHeader("same-origin")
	fmt.Println(header)
}
NewDNTHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewDNTHeader("1")
	fmt.Println(header)
}
NewDPRHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewDPRHeader("2.0")
	fmt.Println(header)
}
NewDateHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewDateHeader("Wed, 21 Oct 2015 07:28:00 GMT")
	fmt.Println(header)
}
NewDeltaBaseHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewDeltaBaseHeader("12340001")
	fmt.Println(header)
}
NewDeviceMemoryHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewDeviceMemoryHeader("2")
	fmt.Println(header)
}
NewDigestHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewDigestHeader("sha-512= 3b761a2a9a96e1c430236dc31378a3450ea189ae1449c3c8eac25cfa8b25381661317968a54cf46bfced09ae6b49f8512832182ac2d087b22380fcb760d802a3")
	fmt.Println(header)
}
NewDownlinkHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewDownlinkHeader("1.7")
	fmt.Println(header)
}
NewECTHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewECTHeader("2g")
	fmt.Println(header)
}
NewETagHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewETagHeader("33a64df551425fcc55e4d42a148795d9f25f89d4")
	fmt.Println(header)
}
NewEarlyDataHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewEarlyDataHeader("1")
	fmt.Println(header)
}
NewExpectHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewExpectHeader("100-continue")
	fmt.Println(header)
}
NewExpectCTHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewExpectCTHeader("max-age=86400", "enforce", "report-uri=\"https://foo.example.com/report\"")
	fmt.Println(header)
}
NewExpiresHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewExpiresHeader("Wed, 21 Oct 2015 07:28:00 GMT")
	fmt.Println(header)
}
NewForwardedHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewForwardedHeader("for=192.0.2.43", "for=198.51.100.17")
	fmt.Println(header)
}
NewFromHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewFromHeader("webmaster@example.org")
	fmt.Println(header)
}
NewFrontEndHTTPSHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewFrontEndHTTPSHeader("on")
	fmt.Println(header)
}
NewHTTP2SettingsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewHTTP2SettingsHeader("token64")
	fmt.Println(header)
}
NewHostHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewHostHeader("Host")
	fmt.Println(header)
}
NewIMHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewIMHeader("feed")
	fmt.Println(header)
}
NewIfMatchHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewIfMatchHeader("737060cd8c284d8af7ad3082f209582d")
	fmt.Println(header)
}
NewIfModifiedSinceHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewIfModifiedSinceHeader("Sat, 29 Oct 1994 19:43:31 GMT")
	fmt.Println(header)
}
NewIfNoneMatchHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewIfNoneMatchHeader("737060cd8c284d8af7ad3082f209582d")
	fmt.Println(header)
}
NewIfRangeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewIfRangeHeader("737060cd8c284d8af7ad3082f209582d")
	fmt.Println(header)
}
NewIfUnmodifiedSinceHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewIfUnmodifiedSinceHeader("Sat, 29 Oct 1994 19:43:31 GMT")
	fmt.Println(header)
}
NewKeepAliveHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewKeepAliveHeader("timeout=5", "max=1000")
	fmt.Println(header)
}
NewLargeAllocationHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewLargeAllocationHeader("500")
	fmt.Println(header)
}
NewLastModifiedHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewLastModifiedHeader("Wed, 21 Oct 2015 07:28:00 GMT")
	fmt.Println(header)
}
NewLinkHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewLinkHeader("<https://one.example.com>; rel=\"preconnect\"", "<https://two.example.com>; rel=\"preconnect\"", "<https://three.example.com>; rel=\"preconnect\"")
	fmt.Println(header)
}
NewLocationHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewLocationHeader("/index.html")
	fmt.Println(header)
}
NewMaxForwardsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewMaxForwardsHeader("10")
	fmt.Println(header)
}
NewNELHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewNELHeader("{ \"report_to\": \"name_of_reporting_group\", \"max_age\": 12345, \"include_subdomains\": false, \"success_fraction\": 0.0, \"failure_fraction\": 1.0 }")
	fmt.Println(header)
}
NewOriginHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewOriginHeader("https://example.com")
	fmt.Println(header)
}
NewP3PHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewP3PHeader("CP=\"https://example.com/P3P\"")
	fmt.Println(header)
}
NewPermissionsPolicyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewPermissionsPolicyHeader("(\"https://example.com\" \"https://a.example.com\" \"https://b.example.com\" \"https://c.example.com\")")
	fmt.Println(header)
}
NewPragmaHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewPragmaHeader("no-cache")
	fmt.Println(header)
}
NewPreferHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewPreferHeader("respond-async", "wait=5")
	fmt.Println(header)
}
NewPreferenceAppliedHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewPreferenceAppliedHeader("return=representation")
	fmt.Println(header)
}
NewProxyAuthenticateHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewProxyAuthenticateHeader("Basic realm=\"Access to the internal site\"")
	fmt.Println(header)
}
NewProxyAuthorizationHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewProxyAuthorizationHeader("Basic YWxhZGRpbjpvcGVuc2VzYW1l")
	fmt.Println(header)
}
NewProxyConnectionHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewProxyConnectionHeader("keep-alive")
	fmt.Println(header)
}
NewPublicKeyPinsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewPublicKeyPinsHeader("max-age=2592000; pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\";")
	fmt.Println(header)
}
NewRTTHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewRTTHeader("123")
	fmt.Println(header)
}
NewRangeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewRangeHeader("bytes=200-1000", "2000-6576", "19000-")
	fmt.Println(header)
}
NewRefererHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewRefererHeader("https://example.com/")
	fmt.Println(header)
}
NewReferrerPolicyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewReferrerPolicyHeader("no-referrer", "strict-origin-when-cross-origin")
	fmt.Println(header)
}
NewRefreshHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewRefreshHeader("5; url=http://www.w3.org/pub/WWW/People.html")
	fmt.Println(header)
}
NewReportToHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewReportToHeader("{ \"group\": \"csp-endpoint\", \"max_age\": 10886400, \"endpoints\": [ { \"url\": \"https-url-of-site-which-collects-reports\" } ] }")
	fmt.Println(header)
}
NewRetryAfterHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewRetryAfterHeader("123")
	fmt.Println(header)
}
NewSaveDataHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSaveDataHeader("on")
	fmt.Println(header)
}
NewSecCHPrefersColorSchemeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHPrefersColorSchemeHeader("dark")
	fmt.Println(header)
}
NewSecCHPrefersReducedMotionHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHPrefersReducedMotionHeader("reduce")
	fmt.Println(header)
}
NewSecCHPrefersReducedTransparencyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHPrefersReducedTransparencyHeader("reduce")
	fmt.Println(header)
}
NewSecCHUAHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAHeader("\"Opera\";v=\"81\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"95\"")
	fmt.Println(header)
}
NewSecCHUAArchHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAArchHeader("x86")
	fmt.Println(header)
}
NewSecCHUABitnessHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUABitnessHeader("64")
	fmt.Println(header)
}
NewSecCHUAFullVersionHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAFullVersionHeader("96.0.4664.110")
	fmt.Println(header)
}
NewSecCHUAFullVersionListHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAFullVersionListHeader("\" Not A;Brand\";v=\"99.0.0.0\", \"Chromium\";v=\"98.0.4750.0\", \"Google Chrome\";v=\"98.0.4750.0\"")
	fmt.Println(header)
}
NewSecCHUAMobileHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAMobileHeader("?1")
	fmt.Println(header)
}
NewSecCHUAModelHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAModelHeader("Pixel 3 XL")
	fmt.Println(header)
}
NewSecCHUAPlatformHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAPlatformHeader("macOS")
	fmt.Println(header)
}
NewSecCHUAPlatformVersionHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecCHUAPlatformVersionHeader("10.0.0")
	fmt.Println(header)
}
NewSecFetchDestHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecFetchDestHeader("image")
	fmt.Println(header)
}
NewSecFetchModeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecFetchModeHeader("no-cors")
	fmt.Println(header)
}
NewSecFetchSiteHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecFetchSiteHeader("cross-site")
	fmt.Println(header)
}
NewSecFetchUserHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecFetchUserHeader("?1")
	fmt.Println(header)
}
NewSecGPCHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecGPCHeader("1")
	fmt.Println(header)
}
NewSecPurposeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecPurposeHeader("prefetch")
	fmt.Println(header)
}
NewSecWebSocketAcceptHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSecWebSocketAcceptHeader("s3pPLMBiTxaQ9kYGzzhZRbK+xOo=")
	fmt.Println(header)
}
NewServerHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewServerHeader("Apache/2.4.1 (Unix)")
	fmt.Println(header)
}
NewServerTimingHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewServerTimingHeader("missedCache")
	fmt.Println(header)
}
NewServiceWorkerNavigationPreloadHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewServiceWorkerNavigationPreloadHeader("json_fragment1")
	fmt.Println(header)
}
NewSetCookieHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSetCookieHeader("id=a3fWa; Expires=Wed, 21 Oct 2015 07:28:00 GM")
	fmt.Println(header)
}
NewSourceMapHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewSourceMapHeader("/static/js/file.js")
	fmt.Println(header)
}
NewStatusHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewStatusHeader("200 OK")
	fmt.Println(header)
}
NewStrictTransportSecurityHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewStrictTransportSecurityHeader("max-age=63072000; includeSubDomains; preload")
	fmt.Println(header)
}
NewTEHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewTEHeader("compress, deflate;q=0.7")
	fmt.Println(header)
}
NewTimingAllowOriginHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewTimingAllowOriginHeader("https://www.example.com")
	fmt.Println(header)
}
NewTKHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewTKHeader("T")
	fmt.Println(header)
}
NewTrailerHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewTrailerHeader("Expires")
	fmt.Println(header)
}
NewTransferEncodingHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewTransferEncodingHeader("gzip", "chunked")
	fmt.Println(header)
}
NewUpgradeHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewUpgradeHeader("example/1", "example/2")
	fmt.Println(header)
}
NewUpgradeInsecureRequestsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewUpgradeInsecureRequestsHeader("1")
	fmt.Println(header)
}
NewUserAgentHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewUserAgentHeader("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36")
	fmt.Println(header)
}
NewVaryHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewVaryHeader("Accept")
	fmt.Println(header)
}
NewViaHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewViaHeader("HTTP/1.1 proxy.example.re", "1.1 edge_1")
	fmt.Println(header)
}
NewViewportWidthHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewViewportWidthHeader("320")
	fmt.Println(header)
}
NewWWWAuthenticateHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewWWWAuthenticateHeader("Basic realm=\"Access to the staging site\", charset=\"UTF-8\"")
	fmt.Println(header)
}
NewWantDigestHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewWantDigestHeader("SHA-512;q=0.3, sha-256;q=1, md5;q=0")
	fmt.Println(header)
}
NewWarningHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewWarningHeader("112 - \"cache down\" \"Wed, 21 Oct 2015 07:28:00 GMT\"")
	fmt.Println(header)
}
NewWidthHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewWidthHeader("1920")
	fmt.Println(header)
}
NewXATTDeviceIDHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXATTDeviceIDHeader("GT-P7320/P7320XXLPG")
	fmt.Println(header)
}
NewXContentDurationHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXContentDurationHeader("42.666")
	fmt.Println(header)
}
NewXContentSecurityPolicyHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXContentSecurityPolicyHeader("default-src 'self'")
	fmt.Println(header)
}
NewXContentTypeOptionsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXContentTypeOptionsHeader("nosniff")
	fmt.Println(header)
}
NewXCorrelationIDHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXCorrelationIDHeader("f058ebd6-02f7-4d3f-942e-904344e8cde5")
	fmt.Println(header)
}
NewXCSRFTokenHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXCSRFTokenHeader("i8XNjC4b8KVok4uw5RftR38Wgp2BFwql")
	fmt.Println(header)
}
NewXDNSPrefetchControlHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXDNSPrefetchControlHeader("off")
	fmt.Println(header)
}
NewXForwardedForHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXForwardedForHeader("203.0.113.195", "2001:db8:85a3:8d3:1319:8a2e:370:7348")
	fmt.Println(header)
}
NewXForwardedHostHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXForwardedHostHeader("id42.example-cdn.com")
	fmt.Println(header)
}
NewXForwardedProtoHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXForwardedProtoHeader("https")
	fmt.Println(header)
}
NewXFrameOptionsHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXFrameOptionsHeader("SAMEORIGIN")
	fmt.Println(header)
}
NewXHTTPMethodOverrideHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXHTTPMethodOverrideHeader("DELETE")
	fmt.Println(header)
}
NewXPoweredByHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXPoweredByHeader("PHP/5.4.0")
	fmt.Println(header)
}
NewXRedirectByHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXRedirectByHeader("WordPress")
	fmt.Println(header)
}
NewXRequestIDHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXRequestIDHeader("f058ebd6-02f7-4d3f-942e-904344e8cde5")
	fmt.Println(header)
}
NewXRequestedWithHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXRequestedWithHeader("XMLHttpRequest")
	fmt.Println(header)
}
NewXUACompatibleHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXUACompatibleHeader("IE=EmulateIE7")
	fmt.Println(header)
}
NewXUIDHHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXUIDHHeader("...")
	fmt.Println(header)
}
NewXWapProfileHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXWapProfileHeader("http://wap.samsungmobile.com/uaprof/SGH-I777.xml")
	fmt.Println(header)
}
NewXWebKitCSPHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXWebKitCSPHeader("default-src 'self'")
	fmt.Println(header)
}
NewXXSSProtectionHeader
// GitHub goheader example.
package main

// Import the goheader package.
import "github.com/lindsaygelle/goheader"

func main() {
	// Create a new HTTP header for use in HTTP client.
	header := goheader.NewXXSSProtectionHeader("1; mode=block")
	fmt.Println(header)
}

Examples

ResponseWriter

Adding new Headers to an existing http.ResponseWriter.

// GitHub goheader example.
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a default handler.
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		// Create a new set of goheader.Header instances.
		headers := []goheader.Header{
			goheader.NewContentLanguageHeader("en-AU"),
			goheader.NewContentTypeHeader("application/json"),
			goheader.NewCookieHeader("language=golang")}

		// Add the headers to the http.ResponseWriter.
		goheader.WriteHeaders(w, headers...)
		// Write the HTTP status code.
		w.WriteHeader(http.StatusOK)
		// Write the HTTP response.
		json.NewEncoder(w).Encode(w.Header()) // { "Content-Language": [ "en-AU" ], "Content-Type": [ "application/json" ], "Cookie": [ "language=golang" ] }
	})
	// Set the port for the server.
	serverAddress := fmt.Sprintf(":%d", 8080)
	// Serve content.
	log.Println(http.ListenAndServe(serverAddress, nil))
}

Docker

A Dockerfile is provided for individuals that prefer containerized development.

Building

Building the Docker container:

docker build . -t goheader
Running

Developing and running Go within the Docker container:

docker run -it --rm --name goheader goheader

Docker Compose

A docker-compose file has also been included for convenience:

Running

Running the compose file.

docker-compose up -d

Contributing

We warmly welcome contributions to Goheader. Whether you have innovative ideas, bug reports, or enhancements in mind, please share them with us by submitting GitHub issues or creating pull requests. For substantial contributions, it's a good practice to start a discussion by creating an issue to ensure alignment with the project's goals and direction. Refer to the CONTRIBUTING file for comprehensive details.

Branching

For a smooth collaboration experience, we have established branch naming conventions and guidelines. Please consult the BRANCH_NAMING_CONVENTION document for comprehensive information and best practices.

License

Goheader is released under the MIT License, granting you the freedom to use, modify, and distribute the code within this repository in accordance with the terms of the license. For additional information, please review the LICENSE file.

Security

If you discover a security vulnerability within this project, please consult the SECURITY document for information and next steps.

Code Of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For additional information, please review the CODE_OF_CONDUCT file.

Acknowledgements

Big thanks to egonelbre/gophers for providing the delightful Gopher artwork used in the social preview. Don't hesitate to pay them a visit!

References

The information for this package was sourced from the following sites.

Mozilla Developer Network The go-to resource for comprehensive HTTP header information.

Wikipedia A reliable reference providing detailed insights into various HTTP header fields.

http.dev A valuable platform offering expert guidance and best practices in HTTP development.

If you spot any discrepancies or have additional insights, don't hesitate to reach out!

Documentation ΒΆ

Overview ΒΆ

Package goheader provides helper functions and predefined header names for creating both standard and custom HTTP headers in Golang applications. It simplifies the process of managing headers, ensuring compatibility and ease of use in various HTTP-related tasks.

Index ΒΆ

Examples ΒΆ

Constants ΒΆ

View Source
const AIM = "A-IM"

AIM header field is used to indicate acceptable instance-manipulations for the request.

View Source
const Accept = "Accept"

Accept header field is used to specify certain media types which are acceptable for the response.

View Source
const AcceptCH = "Accept-CH"

AcceptCH header field is used to indicate which client hints the server supports.

View Source
const AcceptCHLifetime = "Accept-CH-Lifetime"

AcceptCHLifetime header field is used to indicate the maximum duration (in seconds) for which the user agent should store and make use of the received server configuration.

View Source
const AcceptCharset = "Accept-Charset"

AcceptCharset header field is used to indicate which character encodings are acceptable in the response.

View Source
const AcceptDatetime = "Accept-Datetime"

AcceptDatetime header field is used to indicate the date and time formats that the client supports.

View Source
const AcceptEncoding = "Accept-Encoding"

AcceptEncoding header field is used to indicate which content codings are acceptable in the response.

View Source
const AcceptLanguage = "Accept-Language"

AcceptLanguage header field is used to indicate which natural languages are preferred for the response.

View Source
const AcceptPatch = "Accept-Patch"

AcceptPatch header field is used to indicate which patch document formats are accepted by the server.

View Source
const AcceptPost = "Accept-Post"

AcceptPost header field is used to indicate which media types are accepted in the body of the request if the request method does not natively support the media type.

View Source
const AcceptRanges = "Accept-Ranges"

AcceptRanges header field is used to indicate which range units are supported by the server.

View Source
const AccessControlAllowCredentials = "Access-Control-Allow-Credentials"

AccessControlAllowCredentials header field is used to indicate whether the response can be shared when requests are made with credentials.

View Source
const AccessControlAllowHeaders = "Access-Control-Allow-Headers"

AccessControlAllowHeaders header field is used to specify which headers are allowed in a preflight request via the Access-Control-Request-Headers header.

View Source
const AccessControlAllowMethods = "Access-Control-Allow-Methods"

AccessControlAllowMethods header field is used to specify the methods that are allowed when accessing the resource in response to a preflight request.

View Source
const AccessControlAllowOrigin = "Access-Control-Allow-Origin"

AccessControlAllowOrigin header field is used to specify which origins are allowed to access the resource.

View Source
const AccessControlExposeHeaders = "Access-Control-Expose-Headers"

AccessControlExposeHeaders header field is used to specify which headers should be exposed to the response.

View Source
const AccessControlMaxAge = "Access-Control-Max-Age"

AccessControlMaxAge header field is used to indicate how long the results of a preflight request can be cached.

View Source
const AccessControlRequestHeaders = "Access-Control-Request-Headers"

AccessControlRequestHeaders header field is used to indicate which headers can be used during the actual request.

View Source
const AccessControlRequestMethod = "Access-Control-Request-Method"

AccessControlRequestMethod header field is used to indicate which method can be used during the actual request.

View Source
const Age = "Age"

Age header field is used to indicate the age of the response.

View Source
const Allow = "Allow"

Allow header field is used to indicate the HTTP methods that are supported by the resource.

View Source
const AltSvc = "Alt-Svc"

AltSvc header field is used to indicate that an alternative service is available for the given resource.

View Source
const AltUsed = "Alt-Used"

AltUsed header field is used to indicate which alternative service was selected and why.

View Source
const Authorization = "Authorization"

Authorization header field is used to contain credentials for authenticating the client with the server.

View Source
const CacheControl = "Cache-Control"

CacheControl header field is used to specify directives for caching mechanisms in both requests and responses.

View Source
const ClearSiteData = "Clear-Site-Data"

ClearSiteData header field is used to instruct the user agent to clear the browsing context's data.

View Source
const Connection = "Connection"

Connection header field is used to control options for the current connection.

View Source
const ContentDPR = "Content-DPR"

ContentDPR header field is used to specify the ratio of physical pixels to CSS pixels for the resource.

View Source
const ContentDisposition = "Content-Disposition"

ContentDisposition header field is used to suggest a default filename for the data if the user decides to save it to a file.

View Source
const ContentEncoding = "Content-Encoding"

ContentEncoding header field is used to specify the encoding transformations that have been applied to the resource.

View Source
const ContentLanguage = "Content-Language"

ContentLanguage header field is used to describe the natural language(s) of the intended audience for the representation.

View Source
const ContentLength = "Content-Length"

ContentLength header field is used to indicate the size of the response body in octets (8-bit bytes).

View Source
const ContentLocation = "Content-Location"

ContentLocation header field is used to provide a URI for the source of the representation.

View Source
const ContentMD5 = "Content-MD5"

ContentMD5 header field is used as an integrity check of the entity body.

View Source
const ContentRange = "Content-Range"

ContentRange header field is used to indicate where in a full body message a partial message belongs.

View Source
const ContentSecurityPolicy = "Content-Security-Policy"

ContentSecurityPolicy header field is used to define a Content Security Policy (CSP) that should be applied to the response.

View Source
const ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"

ContentSecurityPolicyReportOnly header field is used to define a Content Security Policy (CSP) for the user agent to enforce.

View Source
const ContentType = "Content-Type"

ContentType header field is used to indicate the media type of the resource.

View Source
const Cookie = "Cookie"

Cookie header field is used to send cookies from the server to the user agent.

View Source
const CorrelationID = "Correlation-ID"

CorrelationID header field is used to uniquely identify a request in a distributed system.

View Source
const CriticalCH = "Critical-CH"

CriticalCH header field is used to indicate which client hints are critical for the server to deliver an effective response.

View Source
const CrossOriginEmbedderPolicy = "Cross-Origin-Embedder-Policy"

CrossOriginEmbedderPolicy header field is used to specify which state the user agent should apply to cross-origin requests initiated by the resource.

View Source
const CrossOriginOpenerPolicy = "Cross-Origin-Opener-Policy"

CrossOriginOpenerPolicy header field is used to specify which state the user agent should apply to cross-origin windows.

View Source
const CrossOriginResourcePolicy = "Cross-Origin-Resource-Policy"

CrossOriginResourcePolicy header field is used to specify which state the user agent should apply to a cross-origin request for the resource.

View Source
const DNT = "DNT"

DNT (Do Not Track) header field is used to inform websites that the user does not want to be tracked.

View Source
const DPR = "DPR"

DPR (Device Pixel Ratio) header field is used to indicate the ratio of physical pixels to CSS pixels for the current display device.

View Source
const Date = "Date"

Date header field is used to represent the date and time at which the message was sent.

View Source
const DeltaBase = "Delta-Base"

DeltaBase header field is used to indicate the delta encoding base resource URI.

View Source
const DeviceMemory = "Device-Memory"

DeviceMemory header field is used to indicate the approximate amount of RAM the device has available.

View Source
const Digest = "Digest"

Digest header field is used to indicate the digest algorithm and value for the resource.

View Source
const Downlink = "Downlink"

Downlink header field is used to indicate the effective network bandwidth in megabits per second.

View Source
const ECT = "ECT"

ECT (Effective Connection Type) header field is used to indicate the effective network type and its maximum downlink speed.

View Source
const ETag = "ETag"

ETag header field is used to provide the current entity tag for the requested resource.

View Source
const EarlyData = "Early-Data"

EarlyData header field is used to indicate that the request should be handled as early data.

View Source
const Expect = "Expect"

Expect header field is used to indicate certain requirements that the server must fulfill to create an HTTP response.

View Source
const ExpectCT = "Expect-CT"

ExpectCT header field is used to indicate that the server must support the Expect-CT header field.

View Source
const Expires = "Expires"

Expires header field is used to specify the date and time after which the response is considered stale.

View Source
const Forwarded = "Forwarded"

Forwarded header field is used to capture the information of the originating client and any intermediate proxies or gateways.

View Source
const From = "From"

From header field is used to indicate an Internet email address for a human user who controls the requesting user agent.

View Source
const FrontEndHTTPS = "Front-End-Https"

FrontEndHTTPS header field is used to indicate that the client connected via HTTPS.

View Source
const HTTP2Settings = "HTTP2-Settings"

HTTP2Settings header field is used to convey the HTTP/2 settings for a peer.

View Source
const Host = "Host"

Host header field is used to specify the domain name of the server and the TCP port number on which the server is listening.

View Source
const IM = "IM"

IM header field is used to indicate the instance-manipulations that have been applied to the response.

View Source
const IfMatch = "If-Match"

IfMatch header field is used to make a request method conditional on the current existence or value of an entity.

View Source
const IfModifiedSince = "If-Modified-Since"

IfModifiedSince header field is used to make a request method conditional on the modification date of the resource.

View Source
const IfNoneMatch = "If-None-Match"

IfNoneMatch header field is used to make a request method conditional on the absence or presence of a current representation of the target resource.

View Source
const IfRange = "If-Range"

IfRange header field is used to make a range request that is conditional on the state of the target resource.

View Source
const IfUnmodifiedSince = "If-Unmodified-Since"

IfUnmodifiedSince header field is used to make a request method conditional on the absence or presence and modification date of a current representation of the target resource.

View Source
const KeepAlive = "Keep-Alive"

KeepAlive header field is used to allow the sender to hint about how the connection might be used.

View Source
const LargeAllocation = "Large-Allocation"

LargeAllocation header field is used to indicate that the response is a large allocation of resources.

View Source
const LastModified = "Last-Modified"

LastModified header field is used to indicate the date and time at which the origin server believes the resource was last modified.

View Source
const Link = "Link"

Link header field is used to convey one or more links in the HTTP header.

View Source
const Location = "Location"

Location header field is used in the responses from an HTTP server to redirect the recipient to a different URL.

View Source
const MaxForwards = "Max-Forwards"

MaxForwards header field is used to limit the number of times that the request is forwarded by proxies or gateways.

View Source
const NEL = "NEL"

NEL (Network Error Logging) header field is used to send reports of network errors from the document to a receiver.

View Source
const Origin = "Origin"

Origin header field is used to indicate the origin of the resource.

View Source
const P3P = "P3P"

P3P (Platform for Privacy Preferences) header field is used to indicate the privacy policy of the server.

View Source
const PermissionsPolicy = "Permissions-Policy"

PermissionsPolicy header field is used to enable an API to allow or deny the use of features that may allow for access to device capabilities or user data.

View Source
const Pragma = "Pragma"

Pragma header field is used to include implementation-specific directives that might apply to any recipient along the request/response chain.

View Source
const Prefer = "Prefer"

Prefer header field is used to indicate the request's preferences regarding specific behaviors, such as return representations or server processing.

View Source
const PreferenceApplied = "Preference-Applied"

PreferenceApplied header field is used to indicate the request's preferences that have been applied by the server.

View Source
const ProxyAuthenticate = "Proxy-Authenticate"

ProxyAuthenticate header field is used to challenge the authorization of the client before a proxy can be set up.

View Source
const ProxyAuthorization = "Proxy-Authorization"

ProxyAuthorization header field is used to provide authentication information for proxies that require authentication.

View Source
const ProxyConnection = "Proxy-Connection"

ProxyConnection header field is used to specify options for the connection.

View Source
const PublicKeyPins = "Public-Key-Pins"

PublicKeyPins header field is used to associate a specific cryptographic public key with a certain web server.

View Source
const RTT = "RTT"

RTT (Round-Trip Time) header field is used to indicate the round-trip time of the connection.

View Source
const Range = "Range"

Range header field is used to request only part of an entity in the response.

View Source
const Referer = "Referer"

Referer header field specifies the address of the previous web page from which a link to the currently requested page was followed.

View Source
const ReferrerPolicy = "Referrer-Policy"

ReferrerPolicy header field controls how much referrer information (sent via the Referer header) should be included with requests.

View Source
const Refresh = "Refresh"

Refresh header field is used to specify a delay before the browser should reload the current resource.

View Source
const ReportTo = "Report-To"

ReportTo header field is used to specify a URI to which the user agent sends reports about various issues.

View Source
const RetryAfter = "Retry-After"

RetryAfter header field indicates how long the user agent should wait before making a follow-up request.

View Source
const SaveData = "Save-Data"

SaveData header field is used to indicate that the user's data saver is enabled.

View Source
const SecCHPrefersColorScheme = "Sec-CH-Prefers-Color-Scheme"

SecCHPrefersColorScheme header field is used to indicate the user's preference for a light or dark color scheme.

View Source
const SecCHPrefersReducedMotion = "Sec-CH-Prefers-Reduced-Motion"

SecCHPrefersReducedMotion header field is used to indicate the user's preference for reduced motion.

View Source
const SecCHPrefersReducedTransparency = "Sec-CH-Prefers-Reduced-Transparency"

SecCHPrefersReducedTransparency header field is used to indicate the user's preference for reduced transparency.

View Source
const SecCHUA = "Sec-CH-UA"

SecCHUA header field is used to indicate the user agent string.

View Source
const SecCHUAArch = "Sec-CH-UA-Arch"

SecCHUAArch header field is used to indicate the architecture of the user agent.

View Source
const SecCHUABitness = "Sec-CH-UA-Bitness"

SecCHUABitness header field is used to indicate the bitness of the user agent.

View Source
const SecCHUAFullVersion = "Sec-CH-UA-Full-Version"

SecCHUAFullVersion header field is used to indicate the full version of the user agent.

View Source
const SecCHUAFullVersionList = "Sec-CH-UA-Full-Version-List"

SecCHUAFullVersionList header field is used to indicate a list of full versions of the user agent.

View Source
const SecCHUAMobile = "Sec-CH-UA-Mobile"

SecCHUAMobile header field is used to indicate whether the user agent is a mobile device.

View Source
const SecCHUAModel = "Sec-CH-UA-Model"

SecCHUAModel header field is used to indicate the model of the user agent device.

View Source
const SecCHUAPlatform = "Sec-CH-UA-Platform"

SecCHUAPlatform header field is used to indicate the platform of the user agent.

View Source
const SecCHUAPlatformVersion = "Sec-CH-UA-Platform-Version"

SecCHUAPlatformVersion header field is used to indicate the version of the platform of the user agent.

View Source
const SecFetchDest = "Sec-Fetch-Dest"

SecFetchDest header field is used to indicate the destination of the fetch request.

View Source
const SecFetchMode = "Sec-Fetch-Mode"

SecFetchMode header field is used to indicate the mode of the fetch request.

View Source
const SecFetchSite = "Sec-Fetch-Site"

SecFetchSite header field is used to indicate the site of the fetch request.

View Source
const SecFetchUser = "Sec-Fetch-User"

SecFetchUser header field is used to indicate the user of the fetch request.

View Source
const SecGPC = "Sec-GPC"

SecGPC header field is used to indicate the privacy preferences of the user.

View Source
const SecPurpose = "Sec-Purpose"

SecPurpose header field is used to indicate the purpose of the request.

View Source
const SecWebSocketAccept = "Sec-WebSocket-Accept"

SecWebSocketAccept header field is used in the handshake to indicate the accept value.

View Source
const Server = "Server"

Server header field is used to provide information about the software used by the origin server.

View Source
const ServerTiming = "Server-Timing"

ServerTiming header field is used to communicate one or more metrics and descriptions for the given request-response cycle.

View Source
const ServiceWorkerNavigationPreload = "Service-Worker-Navigation-Preload"

ServiceWorkerNavigationPreload header field is used to indicate the navigation preload state of the service worker.

View Source
const SetCookie = "Set-Cookie"

SetCookie header field is used to send cookies from the server to the user agent.

View Source
const SourceMap = "SourceMap"

SourceMap header field is used to indicate the source map for the requested resource.

View Source
const Status = "Status"

Status header field is used to indicate the status of the response.

View Source
const StrictTransportSecurity = "Strict-Transport-Security"

StrictTransportSecurity header field is used to enable the browser to enforce the use of HTTPS.

View Source
const SupportsLoadingMode = "Supports-Loading-Mode"

SupportsLoadingMode header field is used to opt-in to using various higher-risk loading modes.

View Source
const TE = "TE"

TE header field is used to indicate the transfer codings that are acceptable to the client.

View Source
const TK = "Tk"

TK header field is used to communicate the tracking status requested by the user.

View Source
const TimingAllowOrigin = "Timing-Allow-Origin"

TimingAllowOrigin header field is used to specify origins that are allowed to see values of attributes retrieved via features of the Resource Timing API.

View Source
const Trailer = "Trailer"

Trailer header field is used to indicate that the given set of header fields is present in the trailer of a message encoded with chunked transfer-coding.

View Source
const TransferEncoding = "Transfer-Encoding"

TransferEncoding header field is used to specify the transfer coding of the response.

View Source
const Upgrade = "Upgrade"

Upgrade header field is used to specify additional communication options for the client.

View Source
const UpgradeInsecureRequests = "Upgrade-Insecure-Requests"

UpgradeInsecureRequests header field is used to instruct user agents to treat all of a site's insecure URLs (HTTP) as though they have been replaced with secure URLs (HTTPS).

View Source
const UserAgent = "User-Agent"

UserAgent header field is used to provide information about the user agent (client) making the request.

View Source
const Vary = "Vary"

Vary header field is used to indicate the set of request-header fields that fully determines, while the response is fresh, whether a cache is permitted to use the response to reply to a subsequent request without revalidation.

View Source
const Via = "Via"

Via header field is used to indicate the network path taken by the request message.

View Source
const ViewportWidth = "Viewport-Width"

ViewportWidth header field is used to specify the layout width of the viewport.

View Source
const WWWAuthenticate = "WWW-Authenticate"

WWWAuthenticate header field is used to indicate the authentication method(s) and realm(s) acceptable to the recipient.

View Source
const WantDigest = "Want-Digest"

WantDigest header field is used to indicate that the client supports header field digest values and which algorithm the client prefers.

View Source
const Warning = "Warning"

Warning header field is used to carry additional information about the status or transformation of a message that might not be reflected in the message.

View Source
const Width = "Width"

Width header field is used to specify the intended display width of the resource in CSS pixels.

View Source
const XATTDeviceID = "X-ATT-DeviceId"

XATTDeviceID header field is used to uniquely identify a device in the network.

View Source
const XCSRFToken = "X-Csrf-Token"

XCSRFToken header field is used to provide anti-CSRF (Cross-Site Request Forgery) tokens.

View Source
const XContentDuration = "X-Content-Duration"

XContentDuration header field is used to specify the duration of the resource's content.

View Source
const XContentSecurityPolicy = "X-Content-Security-Policy"

XContentSecurityPolicy header field is used to define a Content Security Policy (CSP) that should be applied to the response.

View Source
const XContentTypeOptions = "X-Content-Type-Options"

XContentTypeOptions header field is used to prevent browsers from interpreting files as a different MIME type.

View Source
const XCorrelationID = "X-Correlation-ID"

XCorrelationID header field is used to uniquely identify a request in a distributed system.

View Source
const XDNSPrefetchControl = "X-DNS-Prefetch-Control"

XDNSPrefetchControl header field is used to control DNS prefetching.

View Source
const XForwardedFor = "X-Forwarded-For"

XForwardedFor header field is used to identify the originating IP address of a client connecting to a web server through an HTTP proxy or a load balancer.

View Source
const XForwardedHost = "X-Forwarded-Host"

XForwardedHost header field is used to identify the original host requested by the client in the Host HTTP request header.

View Source
const XForwardedProto = "X-Forwarded-Proto"

XForwardedProto header field is used to indicate the original protocol (HTTP or HTTPS) that a client used to connect to your proxy or load balancer.

View Source
const XFrameOptions = "X-Frame-Options"

XFrameOptions header field is used to control whether a browser should be allowed to render a page in a <frame>, <iframe>, <embed>, <object>, or <applet>.

View Source
const XHTTPMethodOverride = "X-Http-Method-Override"

XHTTPMethodOverride header field is used to override the method specified in the request line with the method given in the header field.

View Source
const XPoweredBy = "X-Powered-By"

XPoweredBy header field is used to indicate the technology (e.g., server framework, language) powering a website.

View Source
const XRedirectBy = "X-Redirect-By"

XRedirectBy header field is used to indicate the entity responsible for the redirection in the response.

View Source
const XRequestID = "X-Request-ID"

XRequestID header field is used to uniquely identify a request.

View Source
const XRequestedWith = "X-Requested-With"

XRequestedWith header field is used to indicate the type of request (e.g., XMLHttpRequest) made by the user agent.

View Source
const XUACompatible = "X-UA-Compatible"

XUACompatible header field is used to control the version of Internet Explorer (IE) that a web page should be rendered as.

View Source
const XUIDH = "X-UIDH"

XUIDH header field is used to enable a service provider to uniquely identify a subscriber.

View Source
const XWapProfile = "X-Wap-Profile"

XWapProfile header field is used to provide a link to a WAP (Wireless Application Protocol) profile document.

View Source
const XWebKitCSP = "X-WebKit-CSP"

XWebKitCSP header field is used to specify a Content Security Policy (CSP) for a web page.

View Source
const XXSSProtection = "X-XSS-Protection"

XXSSProtection header field is used to enable or disable the Cross-site Scripting (XSS) filter in the user agent.

Variables ΒΆ

This section is empty.

Functions ΒΆ

func NewHeaders ΒΆ added in v1.0.0

func NewHeaders(headers ...*Header) http.Header

NewHeaders creates a new http.Header instance from a collection of Header structs. It takes a variadic number of *Header pointers as input, where each Header contains information about an HTTP header including its name and associated values. The function creates an http.Header instance and populates it with the provided headers' names as keys and their associated values as slices of strings.

// Create a new Header instance.
header1 := goheader.Header{
  Name: "Content-Type",
  Values: []string{"application/json"}}

// Create another Header instance.
header2 := goheader.Header{
  Name: "Authorization",
  Values: []string{"Bearer Token"}}

headers := goheader.NewHeaders(header1, header2)
fmt.Println(headers) // Output: map[Content-Type:[application/json] Authorization:[Bearer Token]]

func WriteHeaders ΒΆ added in v1.0.0

func WriteHeaders(writer interface{ Header() http.Header }, headers ...Header)

WriteHeaders writes the provided headers to the given http.ResponseWriter object. It maps the headers based on their names to the corresponding values and sets them in the http.ResponseWriter object's header. If a header with the same name already exists, its values will be updated with the new ones provided.

// Create a default handler.
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
	// Create a new set of goheader.Header instances.
	headers := []goheader.Header{
		goheader.NewContentLanguageHeader("en-AU"),
		goheader.NewContentTypeHeader("application/json"),
		goheader.NewCookieHeader("language=golang")}

	// Add the headers to the http.ResponseWriter.
	goheader.WriteHeaders(w, headers...)
	// Write the HTTP status code.
	w.WriteHeader(http.StatusOK)
	// Write the HTTP response.
	json.NewEncoder(w).Encode(w.Header()) // { "Content-Language": [ "en-AU" ], "Content-Type": [ "application/json" ], "Cookie": [ "language=golang" ] }
})
Example ΒΆ

ExampleWriteHeaders is an example function for WriteHeaders.

package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a default handler.
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		// Create a new set of goheader.Header instances.
		headers := []goheader.Header{
			goheader.NewContentLanguageHeader("en-AU"),
			goheader.NewContentTypeHeader("application/json"),
			goheader.NewCookieHeader("language=golang")}

		// Add the headers to the http.ResponseWriter.
		goheader.WriteHeaders(w, headers...)
		// Write the HTTP status code.
		w.WriteHeader(http.StatusOK)
		// Write the HTTP response.
		json.NewEncoder(w).Encode(w.Header())
	})
	// Set the port for the server.
	serverAddress := fmt.Sprintf(":%d", 8080)
	// Serve content.
	log.Println(http.ListenAndServe(serverAddress, nil))
}
Output:

Types ΒΆ

type Header struct {
	Experimental bool     // Experimental indicates whether the header is an experimental HTTP header.
	Name         string   // Name represents the name of the header.
	Request      bool     // Request indicates whether the header is applicable for HTTP requests.
	Response     bool     // Response indicates whether the header is applicable for HTTP responses.
	Standard     bool     // Standard indicates whether the header is a standard HTTP header.
	Values       []string // Values contains the associated values of the header.
}

Header represents an HTTP header.

func NewAIMHeader ΒΆ added in v1.0.0

func NewAIMHeader(values ...string) Header

NewAIMHeader creates a new A-IM Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/A-IM

// Create a new Header instance.
newHeader := goheader.NewAIMHeader("Example", "Values")
fmt.Println(newHeader.Name) // A-IM
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAIMHeader is an example function for NewAIMHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAIMHeader("feed")
	fmt.Println(header)
}
Output:

func NewAcceptCHHeader ΒΆ added in v1.0.0

func NewAcceptCHHeader(values ...string) Header

NewAcceptCHHeader creates a new Accept-CH Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-CH

// Create a new Header instance.
newHeader := goheader.NewAcceptCHHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-CH
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptCHHeader is an example function for NewAcceptCHHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptCHHeader("width")
	fmt.Println(header)
}
Output:

func NewAcceptCHLifetimeHeader ΒΆ added in v1.0.0

func NewAcceptCHLifetimeHeader(values ...string) Header

NewAcceptCHLifetimeHeader creates a new Accept-CH-Lifetime Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-CH-Lifetime

// Create a new Header instance.
newHeader := goheader.NewAcceptCHLifetimeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-CH-Lifetime
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptCHLifetimeHeader is an example function for NewAcceptCHLifetimeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptCHLifetimeHeader("86400")
	fmt.Println(header)
}
Output:

func NewAcceptCharsetHeader ΒΆ added in v1.0.0

func NewAcceptCharsetHeader(values ...string) Header

NewAcceptCharsetHeader creates a new Accept-Charset Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Charset

// Create a new Header instance.
newHeader := goheader.NewAcceptCharsetHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-Charset
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ
package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptCharsetHeader("UTF-8")
	fmt.Println(header)
}
Output:

func NewAcceptDatetimeHeader ΒΆ added in v1.0.0

func NewAcceptDatetimeHeader(values ...string) Header

NewAcceptDatetimeHeader creates a new Accept-Datetime Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Datetime

// Create a new Header instance.
newHeader := goheader.NewAcceptDatetimeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-Datetime
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptDatetimeHeader is an example function for NewAcceptDatetimeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptDatetimeHeader("Thu, 31 May 2007 20:35:00 GMT")
	fmt.Println(header)
}
Output:

func NewAcceptEncodingHeader ΒΆ added in v1.0.0

func NewAcceptEncodingHeader(values ...string) Header

NewAcceptEncodingHeader creates a new Accept-Encoding Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding

// Create a new Header instance.
newHeader := goheader.NewAcceptEncodingHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-Encoding
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptEncodingHeader is an example function for NewAcceptEncodingHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptEncodingHeader("gzip")
	fmt.Println(header)
}
Output:

func NewAcceptHeader ΒΆ added in v1.0.0

func NewAcceptHeader(values ...string) Header

NewAcceptHeader creates a new Accept Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept

// Create a new Header instance.
newHeader := goheader.NewAcceptHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptHeader is an example function for NewAcceptHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptHeader("text/html")
	fmt.Println(header)
}
Output:

func NewAcceptLanguageHeader ΒΆ added in v1.0.0

func NewAcceptLanguageHeader(values ...string) Header

NewAcceptLanguageHeader creates a new Accept-Language Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language

// Create a new Header instance.
newHeader := goheader.NewAcceptLanguageHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-Language
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptLanguageHeader is an example function for NewAcceptLanguageHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptLanguageHeader("en-AU")
	fmt.Println(header)
}
Output:

func NewAcceptPatchHeader ΒΆ added in v1.0.0

func NewAcceptPatchHeader(values ...string) Header

NewAcceptPatchHeader creates a new Accept-Patch Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Patch

// Create a new Header instance.
newHeader := goheader.NewAcceptPatchHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-Patch
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptPatchHeader is an example function for NewAcceptPatchHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptPatchHeader("application/example", "text/example")
	fmt.Println(header)
}
Output:

func NewAcceptPostHeader ΒΆ added in v1.0.0

func NewAcceptPostHeader(values ...string) Header

NewAcceptPostHeader creates a new Accept-Post Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Post

// Create a new Header instance.
newHeader := goheader.NewAcceptPostHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-Post
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptPostHeader is an example function for NewAcceptPostHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptPostHeader("application/example", "text/example")
	fmt.Println(header)
}
Output:

func NewAcceptRangesHeader ΒΆ added in v1.0.0

func NewAcceptRangesHeader(values ...string) Header

NewAcceptRangesHeader creates a new Accept-Ranges Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Ranges

// Create a new Header instance.
newHeader := goheader.NewAcceptRangesHeader("Example", "Values")
fmt.Println(newHeader.Name) // Accept-Ranges
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAcceptRangesHeader is an example function for NewAcceptRangesHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAcceptRangesHeader("bytes")
	fmt.Println(header)
}
Output:

func NewAccessControlAllowCredentialsHeader ΒΆ added in v1.0.0

func NewAccessControlAllowCredentialsHeader(values ...string) Header

NewAccessControlAllowCredentialsHeader creates a new Access-Control-Allow-Credentials Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials

// Create a new Header instance.
newHeader := goheader.NewAccessControlAllowCredentialsHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Allow-Credentials
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlAllowCredentialsHeader is an example function for NewAccessControlAllowCredentialsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlAllowCredentialsHeader("true")
	fmt.Println(header)
}
Output:

func NewAccessControlAllowHeadersHeader ΒΆ added in v1.0.0

func NewAccessControlAllowHeadersHeader(values ...string) Header

NewAccessControlAllowHeadersHeader creates a new Access-Control-Allow-Headers Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers

// Create a new Header instance.
newHeader := goheader.NewAccessControlAllowHeadersHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Allow-Headers
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlAllowHeadersHeader is an example function for NewAccessControlAllowHeadersHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlAllowHeadersHeader("*")
	fmt.Println(header)
}
Output:

func NewAccessControlAllowMethodsHeader ΒΆ added in v1.0.0

func NewAccessControlAllowMethodsHeader(values ...string) Header

NewAccessControlAllowMethodsHeader creates a new Access-Control-Allow-Methods Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods

// Create a new Header instance.
newHeader := goheader.NewAccessControlAllowMethodsHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Allow-Methods
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlAllowMethodsHeader is an example function for NewAccessControlAllowMethodsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlAllowMethodsHeader("POST", "GET")
	fmt.Println(header)
}
Output:

func NewAccessControlAllowOriginHeader ΒΆ added in v1.0.0

func NewAccessControlAllowOriginHeader(values ...string) Header

NewAccessControlAllowOriginHeader creates a new Access-Control-Allow-Origin Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin

// Create a new Header instance.
newHeader := goheader.NewAccessControlAllowOriginHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Allow-Origin
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlAllowOriginHeader is an example function for NewAccessControlAllowOriginHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlAllowOriginHeader("*")
	fmt.Println(header)
}
Output:

func NewAccessControlExposeHeadersHeader ΒΆ added in v1.0.0

func NewAccessControlExposeHeadersHeader(values ...string) Header

NewAccessControlExposeHeadersHeader creates a new Access-Control-Expose-Headers Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers

// Create a new Header instance.
newHeader := goheader.NewAccessControlExposeHeadersHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Expose-Headers
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlExposeHeadersHeader is an example function for NewAccessControlExposeHeadersHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlExposeHeadersHeader("https://github.com")
	fmt.Println(header)
}
Output:

func NewAccessControlMaxAgeHeader ΒΆ added in v1.0.0

func NewAccessControlMaxAgeHeader(values ...string) Header

NewAccessControlMaxAgeHeader creates a new Access-Control-Max-Age Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age

// Create a new Header instance.
newHeader := goheader.NewAccessControlMaxAgeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Max-Age
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlMaxAgeHeader is an example function for NewAccessControlMaxAgeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlMaxAgeHeader("600")
	fmt.Println(header)
}
Output:

func NewAccessControlRequestHeadersHeader ΒΆ added in v1.0.0

func NewAccessControlRequestHeadersHeader(values ...string) Header

NewAccessControlRequestHeadersHeader creates a new Access-Control-Request-Headers Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Headers

// Create a new Header instance.
newHeader := goheader.NewAccessControlRequestHeadersHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Request-Headers
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlRequestHeadersHeader is an example function for NewAccessControlRequestHeadersHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlRequestHeadersHeader("Content-Type", "X-User-Addr")
	fmt.Println(header)
}
Output:

func NewAccessControlRequestMethodHeader ΒΆ added in v1.0.0

func NewAccessControlRequestMethodHeader(values ...string) Header

NewAccessControlRequestMethodHeader creates a new Access-Control-Request-Method Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Method

// Create a new Header instance.
newHeader := goheader.NewAccessControlRequestMethodHeader("Example", "Values")
fmt.Println(newHeader.Name) // Access-Control-Request-Method
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAccessControlRequestMethodHeader is an example function for NewAccessControlRequestMethodHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAccessControlRequestMethodHeader("GET")
	fmt.Println(header)
}
Output:

func NewAgeHeader ΒΆ added in v1.0.0

func NewAgeHeader(values ...string) Header

NewAgeHeader creates a new Age Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age

// Create a new Header instance.
newHeader := goheader.NewAgeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Age
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAgeHeader is an example function for NewAgeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAgeHeader("15")
	fmt.Println(header)
}
Output:

func NewAllowHeader ΒΆ added in v1.0.0

func NewAllowHeader(values ...string) Header

NewAllowHeader creates a new Allow Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow

// Create a new Header instance.
newHeader := goheader.NewAllowHeader("Example", "Values")
fmt.Println(newHeader.Name) // Allow
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAllowHeader is an example function for NewAllowHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAllowHeader("HEAD", "GET")
	fmt.Println(header)
}
Output:

func NewAltSvcHeader ΒΆ added in v1.0.0

func NewAltSvcHeader(values ...string) Header

NewAltSvcHeader creates a new Alt-Svc Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Svc

// Create a new Header instance.
newHeader := goheader.NewAltSvcHeader("Example", "Values")
fmt.Println(newHeader.Name) // Alt-Svc
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAltSvcHeader is an example function for NewAltSvcHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAltSvcHeader("h2=\"alt.example.com:443\"", "h2=\":443\"")
	fmt.Println(header)
}
Output:

func NewAltUsedHeader ΒΆ added in v1.0.0

func NewAltUsedHeader(values ...string) Header

NewAltUsedHeader creates a new Alt-Used Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Used

// Create a new Header instance.
newHeader := goheader.NewAltUsedHeader("Example", "Values")
fmt.Println(newHeader.Name) // Alt-Used
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAltUsedHeader is an example function for NewAltUsedHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAltUsedHeader("alternate.example.net")
	fmt.Println(header)
}
Output:

func NewAuthorizationHeader ΒΆ added in v1.0.0

func NewAuthorizationHeader(values ...string) Header

NewAuthorizationHeader creates a new Authorization Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization

// Create a new Header instance.
newHeader := goheader.NewAuthorizationHeader("Example", "Values")
fmt.Println(newHeader.Name) // Authorization
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewAuthorizationHeader is an example function for NewAuthorizationHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewAuthorizationHeader("Basic RXhhbXBsZTphaQ==")
	fmt.Println(header)
}
Output:

func NewCacheControlHeader ΒΆ added in v1.0.0

func NewCacheControlHeader(values ...string) Header

NewCacheControlHeader creates a new Cache-Control Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

// Create a new Header instance.
newHeader := goheader.NewCacheControlHeader("Example", "Values")
fmt.Println(newHeader.Name) // Cache-Control
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewCacheControlHeader is an example function for NewCacheControlHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewCacheControlHeader("max-age=604800")
	fmt.Println(header)
}
Output:

func NewClearSiteDataHeader ΒΆ added in v1.0.0

func NewClearSiteDataHeader(values ...string) Header

NewClearSiteDataHeader creates a new Clear-Site-Data Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data

// Create a new Header instance.
newHeader := goheader.NewClearSiteDataHeader("Example", "Values")
fmt.Println(newHeader.Name) // Clear-Site-Data
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewClearSiteDataHeader is an example function for NewClearSiteDataHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewClearSiteDataHeader("*")
	fmt.Println(header)
}
Output:

func NewConnectionHeader ΒΆ added in v1.0.0

func NewConnectionHeader(values ...string) Header

NewConnectionHeader creates a new Connection Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection

// Create a new Header instance.
newHeader := goheader.NewConnectionHeader("Example", "Values")
fmt.Println(newHeader.Name) // Connection
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewConnectionHeader is an example function for NewConnectionHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewConnectionHeader("keep-alive")
	fmt.Println(header)
}
Output:

func NewContentDPRHeader ΒΆ added in v1.0.0

func NewContentDPRHeader(values ...string) Header

NewContentDPRHeader creates a new Content-DPR Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-DPR

// Create a new Header instance.
newHeader := goheader.NewContentDPRHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-DPR
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentDPRHeader is an example function for NewContentDPRHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentDPRHeader("1")
	fmt.Println(header)
}
Output:

func NewContentDispositionHeader ΒΆ added in v1.0.0

func NewContentDispositionHeader(values ...string) Header

NewContentDispositionHeader creates a new Content-Disposition Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

// Create a new Header instance.
newHeader := goheader.NewContentDispositionHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Disposition
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentDispositionHeader is an example function for NewContentDispositionHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentDispositionHeader("attachment; filename=\"document.doc\"")
	fmt.Println(header)
}
Output:

func NewContentEncodingHeader ΒΆ added in v1.0.0

func NewContentEncodingHeader(values ...string) Header

NewContentEncodingHeader creates a new Content-Encoding Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding

// Create a new Header instance.
newHeader := goheader.NewContentEncodingHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Encoding
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentEncodingHeader is an example function for NewContentEncodingHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentEncodingHeader("deflate", "br")
	fmt.Println(header)
}
Output:

func NewContentLanguageHeader ΒΆ added in v1.0.0

func NewContentLanguageHeader(values ...string) Header

NewContentLanguageHeader creates a new Content-Language Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language

// Create a new Header instance.
newHeader := goheader.NewContentLanguageHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Language
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentLanguageHeader is an example function for NewContentLanguageHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentLanguageHeader("en-AU")
	fmt.Println(header)
}
Output:

func NewContentLengthHeader ΒΆ added in v1.0.0

func NewContentLengthHeader(values ...string) Header

NewContentLengthHeader creates a new Content-Length Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length

// Create a new Header instance.
newHeader := goheader.NewContentLengthHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Length
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentLengthHeader is an example function for NewContentLengthHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentLengthHeader("128")
	fmt.Println(header)
}
Output:

func NewContentLocationHeader ΒΆ added in v1.0.0

func NewContentLocationHeader(values ...string) Header

NewContentLocationHeader creates a new Content-Location Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Location

// Create a new Header instance.
newHeader := goheader.NewContentLocationHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Location
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentLocationHeader is an example function for NewContentLocationHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentLocationHeader("https://example.com/documents/foo")
	fmt.Println(header)
}
Output:

func NewContentMD5Header ΒΆ added in v1.0.0

func NewContentMD5Header(values ...string) Header

NewContentMD5Header creates a new Content-MD5 Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-MD5

// Create a new Header instance.
newHeader := goheader.NewContentMD5Header("Example", "Values")
fmt.Println(newHeader.Name) // Content-MD5
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentMD5Header is an example function for NewContentMD5Header.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentMD5Header("b89f948e98f3a113dc13fdbd3bdb17ef")
	fmt.Println(header)
}
Output:

func NewContentRangeHeader ΒΆ added in v1.0.0

func NewContentRangeHeader(values ...string) Header

NewContentRangeHeader creates a new Content-Range Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range

// Create a new Header instance.
newHeader := goheader.NewContentRangeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Range
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentRangeHeader is an example function for NewContentRangeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentRangeHeader("1000-2000/*")
	fmt.Println(header)
}
Output:

func NewContentSecurityPolicyHeader ΒΆ added in v1.0.0

func NewContentSecurityPolicyHeader(values ...string) Header

NewContentSecurityPolicyHeader creates a new Content-Security-Policy Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

// Create a new Header instance.
newHeader := goheader.NewContentSecurityPolicyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Security-Policy
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentSecurityPolicyHeader is an example function for NewContentSecurityPolicyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentSecurityPolicyHeader("default-src 'self'; font-src fonts.gstatic.com; style-src 'self' fonts.googleapis.com")
	fmt.Println(header)
}
Output:

func NewContentSecurityPolicyReportOnlyHeader ΒΆ added in v1.0.0

func NewContentSecurityPolicyReportOnlyHeader(values ...string) Header

NewContentSecurityPolicyReportOnlyHeader creates a new Content-Security-Policy-Report-Only Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only

// Create a new Header instance.
newHeader := goheader.NewContentSecurityPolicyReportOnlyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Security-Policy-Report-Only
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentSecurityPolicyReportOnlyHeader is an example function for NewContentSecurityPolicyReportOnlyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentSecurityPolicyReportOnlyHeader("default-src https:; report-to /csp-violation-report-endpoint/")
	fmt.Println(header)
}
Output:

func NewContentTypeHeader ΒΆ added in v1.0.0

func NewContentTypeHeader(values ...string) Header

NewContentTypeHeader creates a new Content-Type Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type

// Create a new Header instance.
newHeader := goheader.NewContentTypeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Content-Type
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewContentTypeHeader is an example function for NewContentTypeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewContentTypeHeader("text/html; charset=utf-8")
	fmt.Println(header)
}
Output:

func NewCookieHeader ΒΆ added in v1.0.0

func NewCookieHeader(values ...string) Header

NewCookieHeader creates a new Cookie Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie

// Create a new Header instance.
newHeader := goheader.NewCookieHeader("Example", "Values")
fmt.Println(newHeader.Name) // Cookie
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewCookieHeader is an example function for NewCookieHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewCookieHeader("PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1")
	fmt.Println(header)
}
Output:

func NewCorrelationIDHeader ΒΆ added in v1.0.0

func NewCorrelationIDHeader(values ...string) Header

NewCorrelationIDHeader creates a new Correlation-ID Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Correlation-ID

// Create a new Header instance.
newHeader := goheader.NewCorrelationIDHeader("Example", "Values")
fmt.Println(newHeader.Name) // Correlation-ID
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewCorrelationIDHeader is an example function for NewCorrelationIDHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewCorrelationIDHeader("93dba609-c615-4513-b95b-0d3468ec20d0")
	fmt.Println(header)
}
Output:

func NewCriticalCHHeader ΒΆ added in v1.0.0

func NewCriticalCHHeader(values ...string) Header

NewCriticalCHHeader creates a new Critical-CH Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Critical-CH

// Create a new Header instance.
newHeader := goheader.NewCriticalCHHeader("Example", "Values")
fmt.Println(newHeader.Name) // Critical-CH
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewCriticalCHHeader is an example function for NewCriticalCHHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewCriticalCHHeader("Sec-CH-Prefers-Reduced-Motion")
	fmt.Println(header)
}
Output:

func NewCrossOriginEmbedderPolicyHeader ΒΆ added in v1.0.0

func NewCrossOriginEmbedderPolicyHeader(values ...string) Header

NewCrossOriginEmbedderPolicyHeader creates a new Cross-Origin-Embedder-Policy Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy

// Create a new Header instance.
newHeader := goheader.NewCrossOriginEmbedderPolicyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Cross-Origin-Embedder-Policy
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewCrossOriginEmbedderPolicyHeader is an example function for NewCrossOriginEmbedderPolicyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewCrossOriginEmbedderPolicyHeader("require-corp")
	fmt.Println(header)
}
Output:

func NewCrossOriginOpenerPolicyHeader ΒΆ added in v1.0.0

func NewCrossOriginOpenerPolicyHeader(values ...string) Header

NewCrossOriginOpenerPolicyHeader creates a new Cross-Origin-Opener-Policy Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy

// Create a new Header instance.
newHeader := goheader.NewCrossOriginOpenerPolicyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Cross-Origin-Opener-Policy
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewCrossOriginOpenerPolicyHeader is an example function for NewCrossOriginOpenerPolicyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewCrossOriginOpenerPolicyHeader("same-origin-allow-popups")
	fmt.Println(header)
}
Output:

func NewCrossOriginResourcePolicyHeader ΒΆ added in v1.0.0

func NewCrossOriginResourcePolicyHeader(values ...string) Header

NewCrossOriginResourcePolicyHeader creates a new Cross-Origin-Resource-Policy Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy

// Create a new Header instance.
newHeader := goheader.NewCrossOriginResourcePolicyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Cross-Origin-Resource-Policy
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewCrossOriginResourcePolicyHeader is an example function for NewCrossOriginResourcePolicyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewCrossOriginResourcePolicyHeader("same-origin")
	fmt.Println(header)
}
Output:

func NewDNTHeader ΒΆ added in v1.0.0

func NewDNTHeader(values ...string) Header

NewDNTHeader creates a new DNT Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DNT

// Create a new Header instance.
newHeader := goheader.NewDNTHeader("Example", "Values")
fmt.Println(newHeader.Name) // DNT
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewDNTHeader is an example function for NewDNTHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewDNTHeader("1")
	fmt.Println(header)
}
Output:

func NewDPRHeader ΒΆ added in v1.0.0

func NewDPRHeader(values ...string) Header

NewDPRHeader creates a new DPR Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DPR

// Create a new Header instance.
newHeader := goheader.NewDPRHeader("Example", "Values")
fmt.Println(newHeader.Name) // DPR
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewDPRHeader is an example function for NewDPRHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewDPRHeader("2.0")
	fmt.Println(header)
}
Output:

func NewDateHeader ΒΆ added in v1.0.0

func NewDateHeader(values ...string) Header

NewDateHeader creates a new Date Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date

// Create a new Header instance.
newHeader := goheader.NewDateHeader("Example", "Values")
fmt.Println(newHeader.Name) // Date
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewDateHeader is an example function for NewDateHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewDateHeader("Wed, 21 Oct 2015 07:28:00 GMT")
	fmt.Println(header)
}
Output:

func NewDeltaBaseHeader ΒΆ added in v1.0.0

func NewDeltaBaseHeader(values ...string) Header

NewDeltaBaseHeader creates a new Delta-Base Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Delta-Base

// Create a new Header instance.
newHeader := goheader.NewDeltaBaseHeader("Example", "Values")
fmt.Println(newHeader.Name) // Delta-Base
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewDeltaBaseHeader is an example function for NewDeltaBaseHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewDeltaBaseHeader("12340001")
	fmt.Println(header)
}
Output:

func NewDeviceMemoryHeader ΒΆ added in v1.0.0

func NewDeviceMemoryHeader(values ...string) Header

NewDeviceMemoryHeader creates a new Device-Memory Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Device-Memory

// Create a new Header instance.
newHeader := goheader.NewDeviceMemoryHeader("Example", "Values")
fmt.Println(newHeader.Name) // Device-Memory
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewDeviceMemoryHeader is an example function for NewDeviceMemoryHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewDeviceMemoryHeader("2")
	fmt.Println(header)
}
Output:

func NewDigestHeader ΒΆ added in v1.0.0

func NewDigestHeader(values ...string) Header

NewDigestHeader creates a new Digest Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Digest

// Create a new Header instance.
newHeader := goheader.NewDigestHeader("Example", "Values")
fmt.Println(newHeader.Name) // Digest
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewDigestHeader is an example function for NewDigestHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewDigestHeader("sha-512= 3b761a2a9a96e1c430236dc31378a3450ea189ae1449c3c8eac25cfa8b25381661317968a54cf46bfced09ae6b49f8512832182ac2d087b22380fcb760d802a3")
	fmt.Println(header)
}
Output:

func NewDownlinkHeader ΒΆ added in v1.0.0

func NewDownlinkHeader(values ...string) Header

NewDownlinkHeader creates a new Downlink Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Downlink

// Create a new Header instance.
newHeader := goheader.NewDownlinkHeader("Example", "Values")
fmt.Println(newHeader.Name) // Downlink
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewDownlinkHeader is an example function for NewDownlinkHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewDownlinkHeader("1.7")
	fmt.Println(header)
}
Output:

func NewECTHeader ΒΆ added in v1.0.0

func NewECTHeader(values ...string) Header

NewECTHeader creates a new ECT Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ECT

// Create a new Header instance.
newHeader := goheader.NewECTHeader("Example", "Values")
fmt.Println(newHeader.Name) // ECT
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewECTHeader is an example function for NewECTHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewECTHeader("2g")
	fmt.Println(header)
}
Output:

func NewETagHeader ΒΆ added in v1.0.0

func NewETagHeader(values ...string) Header

NewETagHeader creates a new ETag Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag

// Create a new Header instance.
newHeader := goheader.NewETagHeader("Example", "Values")
fmt.Println(newHeader.Name) // ETag
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewETagHeader is an example function for NewETagHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewETagHeader("33a64df551425fcc55e4d42a148795d9f25f89d4")
	fmt.Println(header)
}
Output:

func NewEarlyDataHeader ΒΆ added in v1.0.0

func NewEarlyDataHeader(values ...string) Header

NewEarlyDataHeader creates a new Early-Data Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Early-Data

// Create a new Header instance.
newHeader := goheader.NewEarlyDataHeader("Example", "Values")
fmt.Println(newHeader.Name) // Early-Data
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewEarlyDataHeader is an example function for NewEarlyDataHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewEarlyDataHeader("1")
	fmt.Println(header)
}
Output:

func NewExpectCTHeader ΒΆ added in v1.0.0

func NewExpectCTHeader(values ...string) Header

NewExpectCTHeader creates a new Expect-CT Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT

// Create a new Header instance.
newHeader := goheader.NewExpectCTHeader("Example", "Values")
fmt.Println(newHeader.Name) // Expect-CT
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewExpectCTHeader is an example function for NewExpectCTHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewExpectCTHeader("max-age=86400", "enforce", "report-uri=\"https://foo.example.com/report\"")
	fmt.Println(header)
}
Output:

func NewExpectHeader ΒΆ added in v1.0.0

func NewExpectHeader(values ...string) Header

NewExpectHeader creates a new Expect Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect

// Create a new Header instance.
newHeader := goheader.NewExpectHeader("Example", "Values")
fmt.Println(newHeader.Name) // Expect
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewExpectHeader is an example function for NewExpectHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewExpectHeader("100-continue")
	fmt.Println(header)
}
Output:

func NewExpiresHeader ΒΆ added in v1.0.0

func NewExpiresHeader(values ...string) Header

NewExpiresHeader creates a new Expires Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires

// Create a new Header instance.
newHeader := goheader.NewExpiresHeader("Example", "Values")
fmt.Println(newHeader.Name) // Expires
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewExpiresHeader is an example function for NewExpiresHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewExpiresHeader("Wed, 21 Oct 2015 07:28:00 GMT")
	fmt.Println(header)
}
Output:

func NewForwardedHeader ΒΆ added in v1.0.0

func NewForwardedHeader(values ...string) Header

NewForwardedHeader creates a new Forwarded Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded

// Create a new Header instance.
newHeader := goheader.NewForwardedHeader("Example", "Values")
fmt.Println(newHeader.Name) // Forwarded
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewForwardedHeader is an example function for NewForwardedHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewForwardedHeader("for=192.0.2.43", "for=198.51.100.17")
	fmt.Println(header)
}
Output:

func NewFromHeader ΒΆ added in v1.0.0

func NewFromHeader(values ...string) Header

NewFromHeader creates a new From Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/From

// Create a new Header instance.
newHeader := goheader.NewFromHeader("Example", "Values")
fmt.Println(newHeader.Name) // From
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewFromHeader is an example function for NewFromHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewFromHeader("webmaster@example.org")
	fmt.Println(header)
}
Output:

func NewFrontEndHTTPSHeader ΒΆ added in v1.0.0

func NewFrontEndHTTPSHeader(values ...string) Header

NewFrontEndHTTPSHeader creates a new Front-End-Https Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Front-End-Https

// Create a new Header instance.
newHeader := goheader.NewFrontEndHTTPSHeader("Example", "Values")
fmt.Println(newHeader.Name) // Front-End-Https
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewFrontEndHTTPSHeader is an example function for NewFrontEndHTTPSHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewFrontEndHTTPSHeader("on")
	fmt.Println(header)
}
Output:

func NewHTTP2SettingsHeader ΒΆ added in v1.0.0

func NewHTTP2SettingsHeader(values ...string) Header

NewHTTP2SettingsHeader creates a new HTTP2-Settings Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/HTTP2-Settings

// Create a new Header instance.
newHeader := goheader.NewHTTP2SettingsHeader("Example", "Values")
fmt.Println(newHeader.Name) // HTTP2-Settings
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewHTTP2SettingsHeader is an example function for NewHTTP2SettingsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewHTTP2SettingsHeader("token64")
	fmt.Println(header)
}
Output:

func NewHostHeader ΒΆ added in v1.0.0

func NewHostHeader(values ...string) Header

NewHostHeader creates a new Host Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host

// Create a new Header instance.
newHeader := goheader.NewHostHeader("Example", "Values")
fmt.Println(newHeader.Name) // Host
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewHostHeader is an example function for NewHostHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewHostHeader("Host")
	fmt.Println(header)
}
Output:

func NewIMHeader ΒΆ added in v1.0.0

func NewIMHeader(values ...string) Header

NewIMHeader creates a new IM Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/IM

// Create a new Header instance.
newHeader := goheader.NewIMHeader("Example", "Values")
fmt.Println(newHeader.Name) // IM
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewIMHeader is an example function for NewIMHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewIMHeader("feed")
	fmt.Println(header)
}
Output:

func NewIfMatchHeader ΒΆ added in v1.0.0

func NewIfMatchHeader(values ...string) Header

NewIfMatchHeader creates a new If-Match Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match

// Create a new Header instance.
newHeader := goheader.NewIfMatchHeader("Example", "Values")
fmt.Println(newHeader.Name) // If-Match
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewIfMatchHeader is an example function for NewIfMatchHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewIfMatchHeader("737060cd8c284d8af7ad3082f209582d")
	fmt.Println(header)
}
Output:

func NewIfModifiedSinceHeader ΒΆ added in v1.0.0

func NewIfModifiedSinceHeader(values ...string) Header

NewIfModifiedSinceHeader creates a new If-Modified-Since Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since

// Create a new Header instance.
newHeader := goheader.NewIfModifiedSinceHeader("Example", "Values")
fmt.Println(newHeader.Name) // If-Modified-Since
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewIfModifiedSinceHeader is an example function for NewIfModifiedSinceHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewIfModifiedSinceHeader("Sat, 29 Oct 1994 19:43:31 GMT")
	fmt.Println(header)
}
Output:

func NewIfNoneMatchHeader ΒΆ added in v1.0.0

func NewIfNoneMatchHeader(values ...string) Header

NewIfNoneMatchHeader creates a new If-None-Match Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match

// Create a new Header instance.
newHeader := goheader.NewIfNoneMatchHeader("Example", "Values")
fmt.Println(newHeader.Name) // If-None-Match
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewIfNoneMatchHeader is an example function for NewIfNoneMatchHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewIfNoneMatchHeader("737060cd8c284d8af7ad3082f209582d")
	fmt.Println(header)
}
Output:

func NewIfRangeHeader ΒΆ added in v1.0.0

func NewIfRangeHeader(values ...string) Header

NewIfRangeHeader creates a new If-Range Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Range

// Create a new Header instance.
newHeader := goheader.NewIfRangeHeader("Example", "Values")
fmt.Println(newHeader.Name) // If-Range
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewIfRangeHeader is an example function for NewIfRangeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewIfRangeHeader("737060cd8c284d8af7ad3082f209582d")
	fmt.Println(header)
}
Output:

func NewIfUnmodifiedSinceHeader ΒΆ added in v1.0.0

func NewIfUnmodifiedSinceHeader(values ...string) Header

NewIfUnmodifiedSinceHeader creates a new If-Unmodified-Since Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since

// Create a new Header instance.
newHeader := goheader.NewIfUnmodifiedSinceHeader("Example", "Values")
fmt.Println(newHeader.Name) // If-Unmodified-Since
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewIfUnmodifiedSinceHeader is an example function for NewIfUnmodifiedSinceHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewIfUnmodifiedSinceHeader("Sat, 29 Oct 1994 19:43:31 GMT")
	fmt.Println(header)
}
Output:

func NewKeepAliveHeader ΒΆ added in v1.0.0

func NewKeepAliveHeader(values ...string) Header

NewKeepAliveHeader creates a new Keep-Alive Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive

// Create a new Header instance.
newHeader := goheader.NewKeepAliveHeader("Example", "Values")
fmt.Println(newHeader.Name) // Keep-Alive
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewKeepAliveHeader is an example function for NewKeepAliveHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewKeepAliveHeader("timeout=5", "max=1000")
	fmt.Println(header)
}
Output:

func NewLargeAllocationHeader ΒΆ added in v1.0.0

func NewLargeAllocationHeader(values ...string) Header

NewLargeAllocationHeader creates a new Large-Allocation Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Large-Allocation

// Create a new Header instance.
newHeader := goheader.NewLargeAllocationHeader("Example", "Values")
fmt.Println(newHeader.Name) // Large-Allocation
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewLargeAllocationHeader is an example function for NewLargeAllocationHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewLargeAllocationHeader("500")
	fmt.Println(header)
}
Output:

func NewLastModifiedHeader ΒΆ added in v1.0.0

func NewLastModifiedHeader(values ...string) Header

NewLastModifiedHeader creates a new Last-Modified Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified

// Create a new Header instance.
newHeader := goheader.NewLastModifiedHeader("Example", "Values")
fmt.Println(newHeader.Name) // Last-Modified
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewLastModifiedHeader is an example function for NewLastModifiedHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewLastModifiedHeader("Wed, 21 Oct 2015 07:28:00 GMT")
	fmt.Println(header)
}
Output:

func NewLinkHeader ΒΆ added in v1.0.0

func NewLinkHeader(values ...string) Header

NewLinkHeader creates a new Link Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link

// Create a new Header instance.
newHeader := goheader.NewLinkHeader("Example", "Values")
fmt.Println(newHeader.Name) // Link
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewLinkHeader is an example function for NewLinkHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewLinkHeader("<https://one.example.com>; rel=\"preconnect\"", "<https://two.example.com>; rel=\"preconnect\"", "<https://three.example.com>; rel=\"preconnect\"")
	fmt.Println(header)
}
Output:

func NewLocationHeader ΒΆ added in v1.0.0

func NewLocationHeader(values ...string) Header

NewLocationHeader creates a new Location Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location

// Create a new Header instance.
newHeader := goheader.NewLocationHeader("Example", "Values")
fmt.Println(newHeader.Name) // Location
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewLocationHeader is an example function for NewLocationHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewLocationHeader("/index.html")
	fmt.Println(header)
}
Output:

func NewMaxForwardsHeader ΒΆ added in v1.0.0

func NewMaxForwardsHeader(values ...string) Header

NewMaxForwardsHeader creates a new Max-Forwards Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Max-Forwards

// Create a new Header instance.
newHeader := goheader.NewMaxForwardsHeader("Example", "Values")
fmt.Println(newHeader.Name) // Max-Forwards
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewMaxForwardsHeader is an example function for NewMaxForwardsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewMaxForwardsHeader("10")
	fmt.Println(header)
}
Output:

func NewNELHeader ΒΆ added in v1.0.0

func NewNELHeader(values ...string) Header

NewNELHeader creates a new NEL Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/NEL

// Create a new Header instance.
newHeader := goheader.NewNELHeader("Example", "Values")
fmt.Println(newHeader.Name) // NEL
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewNELHeader is an example function for NewNELHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewNELHeader("{ \"report_to\": \"name_of_reporting_group\", \"max_age\": 12345, \"include_subdomains\": false, \"success_fraction\": 0.0, \"failure_fraction\": 1.0 }")
	fmt.Println(header)
}
Output:

func NewOriginHeader ΒΆ added in v1.0.0

func NewOriginHeader(values ...string) Header

NewOriginHeader creates a new Origin Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin

// Create a new Header instance.
newHeader := goheader.NewOriginHeader("Example", "Values")
fmt.Println(newHeader.Name) // Origin
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewOriginHeader is an example function for NewOriginHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewOriginHeader("https://example.com")
	fmt.Println(header)
}
Output:

func NewP3PHeader ΒΆ added in v1.0.0

func NewP3PHeader(values ...string) Header

NewP3PHeader creates a new P3P Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/P3P

// Create a new Header instance.
newHeader := goheader.NewP3PHeader("Example", "Values")
fmt.Println(newHeader.Name) // P3P
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewP3PHeader is an example function for NewP3PHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewP3PHeader("CP=\"https://example.com/P3P\"")
	fmt.Println(header)
}
Output:

func NewPermissionsPolicyHeader ΒΆ added in v1.0.0

func NewPermissionsPolicyHeader(values ...string) Header

NewPermissionsPolicyHeader creates a new Permissions-Policy Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy

// Create a new Header instance.
newHeader := goheader.NewPermissionsPolicyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Permissions-Policy
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewPermissionsPolicyHeader is an example function for NewPermissionsPolicyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewPermissionsPolicyHeader("(\"https://example.com\" \"https://a.example.com\" \"https://b.example.com\" \"https://c.example.com\")")
	fmt.Println(header)
}
Output:

func NewPragmaHeader ΒΆ added in v1.0.0

func NewPragmaHeader(values ...string) Header

NewPragmaHeader creates a new Pragma Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Pragma

// Create a new Header instance.
newHeader := goheader.NewPragmaHeader("Example", "Values")
fmt.Println(newHeader.Name) // Pragma
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewPragmaHeader is an example function for NewPragmaHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewPragmaHeader("no-cache")
	fmt.Println(header)
}
Output:

func NewPreferHeader ΒΆ added in v1.0.0

func NewPreferHeader(values ...string) Header

NewPreferHeader creates a new Prefer Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Prefer

// Create a new Header instance.
newHeader := goheader.NewPreferHeader("Example", "Values")
fmt.Println(newHeader.Name) // Prefer
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewPreferHeader is an example function for NewPreferHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewPreferHeader("respond-async", "wait=5")
	fmt.Println(header)
}
Output:

func NewPreferenceAppliedHeader ΒΆ added in v1.0.0

func NewPreferenceAppliedHeader(values ...string) Header

NewPreferenceAppliedHeader creates a new Preference-Applied Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Preference-Applied

// Create a new Header instance.
newHeader := goheader.NewPreferenceAppliedHeader("Example", "Values")
fmt.Println(newHeader.Name) // Preference-Applied
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewPreferenceAppliedHeader is an example function for NewPreferenceAppliedHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewPreferenceAppliedHeader("return=representation")
	fmt.Println(header)
}
Output:

func NewProxyAuthenticateHeader ΒΆ added in v1.0.0

func NewProxyAuthenticateHeader(values ...string) Header

NewProxyAuthenticateHeader creates a new Proxy-Authenticate Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authenticate

// Create a new Header instance.
newHeader := goheader.NewProxyAuthenticateHeader("Example", "Values")
fmt.Println(newHeader.Name) // Proxy-Authenticate
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewProxyAuthenticateHeader is an example function for NewProxyAuthenticateHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewProxyAuthenticateHeader("Basic realm=\"Access to the internal site\"")
	fmt.Println(header)
}
Output:

func NewProxyAuthorizationHeader ΒΆ added in v1.0.0

func NewProxyAuthorizationHeader(values ...string) Header

NewProxyAuthorizationHeader creates a new Proxy-Authorization Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization

// Create a new Header instance.
newHeader := goheader.NewProxyAuthorizationHeader("Example", "Values")
fmt.Println(newHeader.Name) // Proxy-Authorization
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewProxyAuthorizationHeader is an example function for NewProxyAuthorizationHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewProxyAuthorizationHeader("Basic YWxhZGRpbjpvcGVuc2VzYW1l")
	fmt.Println(header)
}
Output:

func NewProxyConnectionHeader ΒΆ added in v1.0.0

func NewProxyConnectionHeader(values ...string) Header

NewProxyConnectionHeader creates a new Proxy-Connection Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Connection

// Create a new Header instance.
newHeader := goheader.NewProxyConnectionHeader("Example", "Values")
fmt.Println(newHeader.Name) // Proxy-Connection
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewProxyConnectionHeader is an example function for NewProxyConnectionHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewProxyConnectionHeader("keep-alive")
	fmt.Println(header)
}
Output:

func NewPublicKeyPinsHeader ΒΆ added in v1.0.0

func NewPublicKeyPinsHeader(values ...string) Header

NewPublicKeyPinsHeader creates a new Public-Key-Pins Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Public-Key-Pins

// Create a new Header instance.
newHeader := goheader.NewPublicKeyPinsHeader("Example", "Values")
fmt.Println(newHeader.Name) // Public-Key-Pins
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewPublicKeyPinsHeader is an example function for NewPublicKeyPinsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewPublicKeyPinsHeader("max-age=2592000; pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\";")
	fmt.Println(header)
}
Output:

func NewRTTHeader ΒΆ added in v1.0.0

func NewRTTHeader(values ...string) Header

NewRTTHeader creates a new RTT Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/RTT

// Create a new Header instance.
newHeader := goheader.NewRTTHeader("Example", "Values")
fmt.Println(newHeader.Name) // RTT
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewRTTHeader is an example function for NewRTTHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewRTTHeader("123")
	fmt.Println(header)
}
Output:

func NewRangeHeader ΒΆ added in v1.0.0

func NewRangeHeader(values ...string) Header

NewRangeHeader creates a new Range Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range

// Create a new Header instance.
newHeader := goheader.NewRangeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Range
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewRangeHeader is an example function for NewRangeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewRangeHeader("bytes=200-1000", "2000-6576", "19000-")
	fmt.Println(header)
}
Output:

func NewRefererHeader ΒΆ added in v1.0.0

func NewRefererHeader(values ...string) Header

NewRefererHeader creates a new Referer Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer

// Create a new Header instance.
newHeader := goheader.NewRefererHeader("Example", "Values")
fmt.Println(newHeader.Name) // Referer
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewRefererHeader is an example function for NewRefererHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewRefererHeader("https://example.com/")
	fmt.Println(header)
}
Output:

func NewReferrerPolicyHeader ΒΆ added in v1.0.0

func NewReferrerPolicyHeader(values ...string) Header

NewReferrerPolicyHeader creates a new Referrer-Policy Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy

// Create a new Header instance.
newHeader := goheader.NewReferrerPolicyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Referrer-Policy
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewReferrerPolicyHeader is an example function for NewReferrerPolicyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewReferrerPolicyHeader("no-referrer", "strict-origin-when-cross-origin")
	fmt.Println(header)
}
Output:

func NewRefreshHeader ΒΆ added in v1.0.0

func NewRefreshHeader(values ...string) Header

NewRefreshHeader creates a new Refresh Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Refresh

// Create a new Header instance.
newHeader := goheader.NewRefreshHeader("Example", "Values")
fmt.Println(newHeader.Name) // Refresh
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewRefreshHeader is an example function for NewRefreshHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewRefreshHeader("5; url=http://www.w3.org/pub/WWW/People.html")
	fmt.Println(header)
}
Output:

func NewReportToHeader ΒΆ added in v1.0.0

func NewReportToHeader(values ...string) Header

NewReportToHeader creates a new Report-To Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Report-To

// Create a new Header instance.
newHeader := goheader.NewReportToHeader("Example", "Values")
fmt.Println(newHeader.Name) // Report-To
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewReportToHeader is an example function for NewReportToHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewReportToHeader("{ \"group\": \"csp-endpoint\", \"max_age\": 10886400, \"endpoints\": [ { \"url\": \"https-url-of-site-which-collects-reports\" } ] }")
	fmt.Println(header)
}
Output:

func NewRetryAfterHeader ΒΆ added in v1.0.0

func NewRetryAfterHeader(values ...string) Header

NewRetryAfterHeader creates a new Retry-After Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After

// Create a new Header instance.
newHeader := goheader.NewRetryAfterHeader("Example", "Values")
fmt.Println(newHeader.Name) // Retry-After
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewRetryAfterHeader is an example function for NewRetryAfterHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewRetryAfterHeader("123")
	fmt.Println(header)
}
Output:

func NewSaveDataHeader ΒΆ added in v1.0.0

func NewSaveDataHeader(values ...string) Header

NewSaveDataHeader creates a new Save-Data Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Save-Data

// Create a new Header instance.
newHeader := goheader.NewSaveDataHeader("Example", "Values")
fmt.Println(newHeader.Name) // Save-Data
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSaveDataHeader is an example function for NewSaveDataHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSaveDataHeader("on")
	fmt.Println(header)
}
Output:

func NewSecCHPrefersColorSchemeHeader ΒΆ added in v1.0.0

func NewSecCHPrefersColorSchemeHeader(values ...string) Header

NewSecCHPrefersColorSchemeHeader creates a new Sec-CH-Prefers-Color-Scheme Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme

// Create a new Header instance.
newHeader := goheader.NewSecCHPrefersColorSchemeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-Prefers-Color-Scheme
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHPrefersColorSchemeHeader is an example function for NewSecCHPrefersColorSchemeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHPrefersColorSchemeHeader("dark")
	fmt.Println(header)
}
Output:

func NewSecCHPrefersReducedMotionHeader ΒΆ added in v1.0.0

func NewSecCHPrefersReducedMotionHeader(values ...string) Header

NewSecCHPrefersReducedMotionHeader creates a new Sec-CH-Prefers-Reduced-Motion Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion

// Create a new Header instance.
newHeader := goheader.NewSecCHPrefersReducedMotionHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-Prefers-Reduced-Motion
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHPrefersReducedMotionHeader is an example function for NewSecCHPrefersReducedMotionHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHPrefersReducedMotionHeader("reduce")
	fmt.Println(header)
}
Output:

func NewSecCHPrefersReducedTransparencyHeader ΒΆ added in v1.0.0

func NewSecCHPrefersReducedTransparencyHeader(values ...string) Header

NewSecCHPrefersReducedTransparencyHeader creates a new Sec-CH-Prefers-Reduced-Transparency Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Transparency

// Create a new Header instance.
newHeader := goheader.NewSecCHPrefersReducedTransparencyHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-Prefers-Reduced-Transparency
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHPrefersReducedTransparencyHeader is an example function for NewSecCHPrefersReducedTransparencyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHPrefersReducedTransparencyHeader("reduce")
	fmt.Println(header)
}
Output:

func NewSecCHUAArchHeader ΒΆ added in v1.0.0

func NewSecCHUAArchHeader(values ...string) Header

NewSecCHUAArchHeader creates a new Sec-CH-UA-Arch Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Arch

// Create a new Header instance.
newHeader := goheader.NewSecCHUAArchHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Arch
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAArchHeader is an example function for NewSecCHUAArchHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAArchHeader("x86")
	fmt.Println(header)
}
Output:

func NewSecCHUABitnessHeader ΒΆ added in v1.0.0

func NewSecCHUABitnessHeader(values ...string) Header

NewSecCHUABitnessHeader creates a new Sec-CH-UA-Bitness Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Bitness

// Create a new Header instance.
newHeader := goheader.NewSecCHUABitnessHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Bitness
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUABitnessHeader is an example function for NewSecCHUABitnessHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUABitnessHeader("64")
	fmt.Println(header)
}
Output:

func NewSecCHUAFullVersionHeader ΒΆ added in v1.0.0

func NewSecCHUAFullVersionHeader(values ...string) Header

NewSecCHUAFullVersionHeader creates a new Sec-CH-UA-Full-Version Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version

// Create a new Header instance.
newHeader := goheader.NewSecCHUAFullVersionHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Full-Version
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAFullVersionHeader is an example function for NewSecCHUAFullVersionHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAFullVersionHeader("96.0.4664.110")
	fmt.Println(header)
}
Output:

func NewSecCHUAFullVersionListHeader ΒΆ added in v1.0.0

func NewSecCHUAFullVersionListHeader(values ...string) Header

NewSecCHUAFullVersionListHeader creates a new Sec-CH-UA-Full-Version-List Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List

// Create a new Header instance.
newHeader := goheader.NewSecCHUAFullVersionListHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Full-Version-List
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAFullVersionListHeader is an example function for NewSecCHUAFullVersionListHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAFullVersionListHeader("\" Not A;Brand\";v=\"99.0.0.0\", \"Chromium\";v=\"98.0.4750.0\", \"Google Chrome\";v=\"98.0.4750.0\"")
	fmt.Println(header)
}
Output:

func NewSecCHUAHeader ΒΆ added in v1.0.0

func NewSecCHUAHeader(values ...string) Header

NewSecCHUAHeader creates a new Sec-CH-UA Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA

// Create a new Header instance.
newHeader := goheader.NewSecCHUAHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAHeader is an example function for NewSecCHUAHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAHeader("\"Opera\";v=\"81\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"95\"")
	fmt.Println(header)
}
Output:

func NewSecCHUAMobileHeader ΒΆ added in v1.0.0

func NewSecCHUAMobileHeader(values ...string) Header

NewSecCHUAMobileHeader creates a new Sec-CH-UA-Mobile Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Mobile

// Create a new Header instance.
newHeader := goheader.NewSecCHUAMobileHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Mobile
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAMobileHeader is an example function for NewSecCHUAMobileHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAMobileHeader("?1")
	fmt.Println(header)
}
Output:

func NewSecCHUAModelHeader ΒΆ added in v1.0.0

func NewSecCHUAModelHeader(values ...string) Header

NewSecCHUAModelHeader creates a new Sec-CH-UA-Model Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Model

// Create a new Header instance.
newHeader := goheader.NewSecCHUAModelHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Model
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAModelHeader is an example function for NewSecCHUAModelHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAModelHeader("Pixel 3 XL")
	fmt.Println(header)
}
Output:

func NewSecCHUAPlatformHeader ΒΆ added in v1.0.0

func NewSecCHUAPlatformHeader(values ...string) Header

NewSecCHUAPlatformHeader creates a new Sec-CH-UA-Platform Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform

// Create a new Header instance.
newHeader := goheader.NewSecCHUAPlatformHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Platform
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAPlatformHeader is an example function for NewSecCHUAPlatformHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAPlatformHeader("macOS")
	fmt.Println(header)
}
Output:

func NewSecCHUAPlatformVersionHeader ΒΆ added in v1.0.0

func NewSecCHUAPlatformVersionHeader(values ...string) Header

NewSecCHUAPlatformVersionHeader creates a new Sec-CH-UA-Platform-Version Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform-Version

// Create a new Header instance.
newHeader := goheader.NewSecCHUAPlatformVersionHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-CH-UA-Platform-Version
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecCHUAPlatformVersionHeader is an example function for NewSecCHUAPlatformVersionHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecCHUAPlatformVersionHeader("10.0.0")
	fmt.Println(header)
}
Output:

func NewSecFetchDestHeader ΒΆ added in v1.0.0

func NewSecFetchDestHeader(values ...string) Header

NewSecFetchDestHeader creates a new Sec-Fetch-Dest Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Dest

// Create a new Header instance.
newHeader := goheader.NewSecFetchDestHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-Fetch-Dest
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecFetchDestHeader is an example function for NewSecFetchDestHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecFetchDestHeader("image")
	fmt.Println(header)
}
Output:

func NewSecFetchModeHeader ΒΆ added in v1.0.0

func NewSecFetchModeHeader(values ...string) Header

NewSecFetchModeHeader creates a new Sec-Fetch-Mode Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Mode

// Create a new Header instance.
newHeader := goheader.NewSecFetchModeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-Fetch-Mode
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecFetchModeHeader is an example function for NewSecFetchModeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecFetchModeHeader("no-cors")
	fmt.Println(header)
}
Output:

func NewSecFetchSiteHeader ΒΆ added in v1.0.0

func NewSecFetchSiteHeader(values ...string) Header

NewSecFetchSiteHeader creates a new Sec-Fetch-Site Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Site

// Create a new Header instance.
newHeader := goheader.NewSecFetchSiteHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-Fetch-Site
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecFetchSiteHeader is an example function for NewSecFetchSiteHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecFetchSiteHeader("cross-site")
	fmt.Println(header)
}
Output:

func NewSecFetchUserHeader ΒΆ added in v1.0.0

func NewSecFetchUserHeader(values ...string) Header

NewSecFetchUserHeader creates a new Sec-Fetch-User Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-User

// Create a new Header instance.
newHeader := goheader.NewSecFetchUserHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-Fetch-User
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecFetchUserHeader is an example function for NewSecFetchUserHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecFetchUserHeader("?1")
	fmt.Println(header)
}
Output:

func NewSecGPCHeader ΒΆ added in v1.0.0

func NewSecGPCHeader(values ...string) Header

NewSecGPCHeader creates a new Sec-GPC Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-GPC

// Create a new Header instance.
newHeader := goheader.NewSecGPCHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-GPC
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecGPCHeader is an example function for NewSecGPCHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecGPCHeader("1")
	fmt.Println(header)
}
Output:

func NewSecPurposeHeader ΒΆ added in v1.0.0

func NewSecPurposeHeader(values ...string) Header

NewSecPurposeHeader creates a new Sec-Purpose Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Purpose

// Create a new Header instance.
newHeader := goheader.NewSecPurposeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-Purpose
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecPurposeHeader is an example function for NewSecPurposeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecPurposeHeader("prefetch")
	fmt.Println(header)
}
Output:

func NewSecWebSocketAcceptHeader ΒΆ added in v1.0.0

func NewSecWebSocketAcceptHeader(values ...string) Header

NewSecWebSocketAcceptHeader creates a new Sec-WebSocket-Accept Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Accept

// Create a new Header instance.
newHeader := goheader.NewSecWebSocketAcceptHeader("Example", "Values")
fmt.Println(newHeader.Name) // Sec-WebSocket-Accept
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSecWebSocketAcceptHeader is an example function for NewSecWebSocketAcceptHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSecWebSocketAcceptHeader("s3pPLMBiTxaQ9kYGzzhZRbK+xOo=")
	fmt.Println(header)
}
Output:

func NewServerHeader ΒΆ added in v1.0.0

func NewServerHeader(values ...string) Header

NewServerHeader creates a new Server Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server

// Create a new Header instance.
newHeader := goheader.NewServerHeader("Example", "Values")
fmt.Println(newHeader.Name) // Server
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewServerHeader is an example function for NewServerHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewServerHeader("Apache/2.4.1 (Unix)")
	fmt.Println(header)
}
Output:

func NewServerTimingHeader ΒΆ added in v1.0.0

func NewServerTimingHeader(values ...string) Header

NewServerTimingHeader creates a new Server-Timing Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing

// Create a new Header instance.
newHeader := goheader.NewServerTimingHeader("Example", "Values")
fmt.Println(newHeader.Name) // Server-Timing
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewServerTimingHeader is an example function for NewServerTimingHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewServerTimingHeader("missedCache")
	fmt.Println(header)
}
Output:

func NewServiceWorkerNavigationPreloadHeader ΒΆ added in v1.0.0

func NewServiceWorkerNavigationPreloadHeader(values ...string) Header

NewServiceWorkerNavigationPreloadHeader creates a new Service-Worker-Navigation-Preload Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Service-Worker-Navigation-Preload

// Create a new Header instance.
newHeader := goheader.NewServiceWorkerNavigationPreloadHeader("Example", "Values")
fmt.Println(newHeader.Name) // Service-Worker-Navigation-Preload
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewServiceWorkerNavigationPreloadHeader is an example function for NewServiceWorkerNavigationPreloadHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewServiceWorkerNavigationPreloadHeader("json_fragment1")
	fmt.Println(header)
}
Output:

func NewSetCookieHeader ΒΆ added in v1.0.0

func NewSetCookieHeader(values ...string) Header

NewSetCookieHeader creates a new Set-Cookie Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie

// Create a new Header instance.
newHeader := goheader.NewSetCookieHeader("Example", "Values")
fmt.Println(newHeader.Name) // Set-Cookie
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSetCookieHeader is an example function for NewSetCookieHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSetCookieHeader("id=a3fWa; Expires=Wed, 21 Oct 2015 07:28:00 GM")
	fmt.Println(header)
}
Output:

func NewSourceMapHeader ΒΆ added in v1.0.0

func NewSourceMapHeader(values ...string) Header

NewSourceMapHeader creates a new SourceMap Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/SourceMap

// Create a new Header instance.
newHeader := goheader.NewSourceMapHeader("Example", "Values")
fmt.Println(newHeader.Name) // SourceMap
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewSourceMapHeader is an example function for NewSourceMapHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewSourceMapHeader("/static/js/file.js")
	fmt.Println(header)
}
Output:

func NewStatusHeader ΒΆ added in v1.0.0

func NewStatusHeader(values ...string) Header

NewStatusHeader creates a new Status Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Status

// Create a new Header instance.
newHeader := goheader.NewStatusHeader("Example", "Values")
fmt.Println(newHeader.Name) // Status
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewStatusHeader is an example function for NewStatusHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewStatusHeader("200 OK")
	fmt.Println(header)
}
Output:

func NewStrictTransportSecurityHeader ΒΆ added in v1.0.0

func NewStrictTransportSecurityHeader(values ...string) Header

NewStrictTransportSecurityHeader creates a new Strict-Transport-Security Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security

// Create a new Header instance.
newHeader := goheader.NewStrictTransportSecurityHeader("Example", "Values")
fmt.Println(newHeader.Name) // Strict-Transport-Security
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewStrictTransportSecurityHeader is an example function for NewStrictTransportSecurityHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewStrictTransportSecurityHeader("max-age=63072000; includeSubDomains; preload")
	fmt.Println(header)
}
Output:

func NewSupportsLoadingModeHeader ΒΆ added in v1.0.0

func NewSupportsLoadingModeHeader(values ...string) Header

NewSupportsLoadingModeHeader creates a new Supports-Loading-Mode Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Supports-Loading-Mode

// Create a new Header instance.
newHeader := goheader.NewSupportsLoadingModeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Supports-Loading-Mode
fmt.Println(newHeader.Value) // ["Example", "Value"]

func NewTEHeader ΒΆ added in v1.0.0

func NewTEHeader(values ...string) Header

NewTEHeader creates a new TE Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/TE

// Create a new Header instance.
newHeader := goheader.NewTEHeader("Example", "Values")
fmt.Println(newHeader.Name) // TE
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewTEHeader is an example function for NewTEHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewTEHeader("compress, deflate;q=0.7")
	fmt.Println(header)
}
Output:

func NewTKHeader ΒΆ added in v1.0.0

func NewTKHeader(values ...string) Header

NewTKHeader creates a new Tk Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Tk

// Create a new Header instance.
newHeader := goheader.NewTKHeader("Example", "Values")
fmt.Println(newHeader.Name) // Tk
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewTKHeader is an example function for NewTKHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewTKHeader("T")
	fmt.Println(header)
}
Output:

func NewTimingAllowOriginHeader ΒΆ added in v1.0.0

func NewTimingAllowOriginHeader(values ...string) Header

NewTimingAllowOriginHeader creates a new Timing-Allow-Origin Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin

// Create a new Header instance.
newHeader := goheader.NewTimingAllowOriginHeader("Example", "Values")
fmt.Println(newHeader.Name) // Timing-Allow-Origin
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewTimingAllowOriginHeader is an example function for NewTimingAllowOriginHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewTimingAllowOriginHeader("https://www.example.com")
	fmt.Println(header)
}
Output:

func NewTrailerHeader ΒΆ added in v1.0.0

func NewTrailerHeader(values ...string) Header

NewTrailerHeader creates a new Trailer Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer

// Create a new Header instance.
newHeader := goheader.NewTrailerHeader("Example", "Values")
fmt.Println(newHeader.Name) // Trailer
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewTrailerHeader is an example function for NewTrailerHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewTrailerHeader("Expires")
	fmt.Println(header)
}
Output:

func NewTransferEncodingHeader ΒΆ added in v1.0.0

func NewTransferEncodingHeader(values ...string) Header

NewTransferEncodingHeader creates a new Transfer-Encoding Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding

// Create a new Header instance.
newHeader := goheader.NewTransferEncodingHeader("Example", "Values")
fmt.Println(newHeader.Name) // Transfer-Encoding
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewTransferEncodingHeader is an example function for NewTransferEncodingHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewTransferEncodingHeader("gzip", "chunked")
	fmt.Println(header)
}
Output:

func NewUpgradeHeader ΒΆ added in v1.0.0

func NewUpgradeHeader(values ...string) Header

NewUpgradeHeader creates a new Upgrade Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade

// Create a new Header instance.
newHeader := goheader.NewUpgradeHeader("Example", "Values")
fmt.Println(newHeader.Name) // Upgrade
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewUpgradeHeader is an example function for NewUpgradeHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewUpgradeHeader("example/1", "example/2")
	fmt.Println(header)
}
Output:

func NewUpgradeInsecureRequestsHeader ΒΆ added in v1.0.0

func NewUpgradeInsecureRequestsHeader(values ...string) Header

NewUpgradeInsecureRequestsHeader creates a new Upgrade-Insecure-Requests Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade-Insecure-Requests

// Create a new Header instance.
newHeader := goheader.NewUpgradeInsecureRequestsHeader("Example", "Values")
fmt.Println(newHeader.Name) // Upgrade-Insecure-Requests
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewUpgradeInsecureRequestsHeader is an example function for NewUpgradeInsecureRequestsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewUpgradeInsecureRequestsHeader("1")
	fmt.Println(header)
}
Output:

func NewUserAgentHeader ΒΆ added in v1.0.0

func NewUserAgentHeader(values ...string) Header

NewUserAgentHeader creates a new User-Agent Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent

// Create a new Header instance.
newHeader := goheader.NewUserAgentHeader("Example", "Values")
fmt.Println(newHeader.Name) // User-Agent
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewUserAgentHeader is an example function for NewUserAgentHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewUserAgentHeader("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36")
	fmt.Println(header)
}
Output:

func NewVaryHeader ΒΆ added in v1.0.0

func NewVaryHeader(values ...string) Header

NewVaryHeader creates a new Vary Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary

// Create a new Header instance.
newHeader := goheader.NewVaryHeader("Example", "Values")
fmt.Println(newHeader.Name) // Vary
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewVaryHeader is an example function for NewVaryHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewVaryHeader("Accept")
	fmt.Println(header)
}
Output:

func NewViaHeader ΒΆ added in v1.0.0

func NewViaHeader(values ...string) Header

NewViaHeader creates a new Via Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Via

// Create a new Header instance.
newHeader := goheader.NewViaHeader("Example", "Values")
fmt.Println(newHeader.Name) // Via
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewViaHeader is an example function for NewViaHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewViaHeader("HTTP/1.1 proxy.example.re", "1.1 edge_1")
	fmt.Println(header)
}
Output:

func NewViewportWidthHeader ΒΆ added in v1.0.0

func NewViewportWidthHeader(values ...string) Header

NewViewportWidthHeader creates a new Viewport-Width Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Viewport-Width

// Create a new Header instance.
newHeader := goheader.NewViewportWidthHeader("Example", "Values")
fmt.Println(newHeader.Name) // Viewport-Width
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewViewportWidthHeader is an example function for NewViewportWidthHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewViewportWidthHeader("320")
	fmt.Println(header)
}
Output:

func NewWWWAuthenticateHeader ΒΆ added in v1.0.0

func NewWWWAuthenticateHeader(values ...string) Header

NewWWWAuthenticateHeader creates a new WWW-Authenticate Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate

// Create a new Header instance.
newHeader := goheader.NewWWWAuthenticateHeader("Example", "Values")
fmt.Println(newHeader.Name) // WWW-Authenticate
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewWWWAuthenticateHeader is an example function for NewWWWAuthenticateHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewWWWAuthenticateHeader("Basic realm=\"Access to the staging site\", charset=\"UTF-8\"")
	fmt.Println(header)
}
Output:

func NewWantDigestHeader ΒΆ added in v1.0.0

func NewWantDigestHeader(values ...string) Header

NewWantDigestHeader creates a new Want-Digest Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Want-Digest

// Create a new Header instance.
newHeader := goheader.NewWantDigestHeader("Example", "Values")
fmt.Println(newHeader.Name) // Want-Digest
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewWantDigestHeader is an example function for NewWantDigestHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewWantDigestHeader("SHA-512;q=0.3, sha-256;q=1, md5;q=0")
	fmt.Println(header)
}
Output:

func NewWarningHeader ΒΆ added in v1.0.0

func NewWarningHeader(values ...string) Header

NewWarningHeader creates a new Warning Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Warning

// Create a new Header instance.
newHeader := goheader.NewWarningHeader("Example", "Values")
fmt.Println(newHeader.Name) // Warning
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewWarningHeader is an example function for NewWarningHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewWarningHeader("112 - \"cache down\" \"Wed, 21 Oct 2015 07:28:00 GMT\"")
	fmt.Println(header)
}
Output:

func NewWidthHeader ΒΆ added in v1.0.0

func NewWidthHeader(values ...string) Header

NewWidthHeader creates a new Width Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Width

// Create a new Header instance.
newHeader := goheader.NewWidthHeader("Example", "Values")
fmt.Println(newHeader.Name) // Width
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewWidthHeader is an example function for NewWidthHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewWidthHeader("1920")
	fmt.Println(header)
}
Output:

func NewXATTDeviceIDHeader ΒΆ added in v1.0.0

func NewXATTDeviceIDHeader(values ...string) Header

NewXATTDeviceIDHeader creates a new X-ATT-DeviceId Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-ATT-DeviceId

// Create a new Header instance.
newHeader := goheader.NewXATTDeviceIDHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-ATT-DeviceId
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXATTDeviceIDHeader is an example function for NewXATTDeviceIDHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXATTDeviceIDHeader("GT-P7320/P7320XXLPG")
	fmt.Println(header)
}
Output:

func NewXCSRFTokenHeader ΒΆ added in v1.0.0

func NewXCSRFTokenHeader(values ...string) Header

NewXCSRFTokenHeader creates a new X-Csrf-Token Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Csrf-Token

// Create a new Header instance.
newHeader := goheader.NewXCSRFTokenHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Csrf-Token
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXCSRFTokenHeader is an example function for NewXCSRFTokenHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXCSRFTokenHeader("i8XNjC4b8KVok4uw5RftR38Wgp2BFwql")
	fmt.Println(header)
}
Output:

func NewXContentDurationHeader ΒΆ added in v1.0.0

func NewXContentDurationHeader(values ...string) Header

NewXContentDurationHeader creates a new X-Content-Duration Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Duration

// Create a new Header instance.
newHeader := goheader.NewXContentDurationHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Content-Duration
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXContentDurationHeader is an example function for NewXContentDurationHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXContentDurationHeader("42.666")
	fmt.Println(header)
}
Output:

func NewXContentSecurityPolicyHeader ΒΆ added in v1.0.0

func NewXContentSecurityPolicyHeader(values ...string) Header

NewXContentSecurityPolicyHeader creates a new X-Content-Security-Policy Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Security-Policy

// Create a new Header instance.
newHeader := goheader.NewXContentSecurityPolicyHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Content-Security-Policy
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXContentSecurityPolicyHeader is an example function for NewXContentSecurityPolicyHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXContentSecurityPolicyHeader("default-src 'self'")
	fmt.Println(header)
}
Output:

func NewXContentTypeOptionsHeader ΒΆ added in v1.0.0

func NewXContentTypeOptionsHeader(values ...string) Header

NewXContentTypeOptionsHeader creates a new X-Content-Type-Options Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options

// Create a new Header instance.
newHeader := goheader.NewXContentTypeOptionsHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Content-Type-Options
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXContentTypeOptionsHeader is an example function for NewXContentTypeOptionsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXContentTypeOptionsHeader("nosniff")
	fmt.Println(header)
}
Output:

func NewXCorrelationIDHeader ΒΆ added in v1.0.0

func NewXCorrelationIDHeader(values ...string) Header

NewXCorrelationIDHeader creates a new X-Correlation-ID Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Correlation-ID

// Create a new Header instance.
newHeader := goheader.NewXCorrelationIDHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Correlation-ID
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXCorrelationIDHeader is an example function for NewXCorrelationIDHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXCorrelationIDHeader("f058ebd6-02f7-4d3f-942e-904344e8cde5")
	fmt.Println(header)
}
Output:

func NewXDNSPrefetchControlHeader ΒΆ added in v1.0.0

func NewXDNSPrefetchControlHeader(values ...string) Header

NewXDNSPrefetchControlHeader creates a new X-DNS-Prefetch-Control Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control

// Create a new Header instance.
newHeader := goheader.NewXDNSPrefetchControlHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-DNS-Prefetch-Control
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXDNSPrefetchControlHeader is an example function for NewXDNSPrefetchControlHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXDNSPrefetchControlHeader("off")
	fmt.Println(header)
}
Output:

func NewXForwardedForHeader ΒΆ added in v1.0.0

func NewXForwardedForHeader(values ...string) Header

NewXForwardedForHeader creates a new X-Forwarded-For Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For

// Create a new Header instance.
newHeader := goheader.NewXForwardedForHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Forwarded-For
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXForwardedForHeader is an example function for NewXForwardedForHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXForwardedForHeader("203.0.113.195", "2001:db8:85a3:8d3:1319:8a2e:370:7348")
	fmt.Println(header)
}
Output:

func NewXForwardedHostHeader ΒΆ added in v1.0.0

func NewXForwardedHostHeader(values ...string) Header

NewXForwardedHostHeader creates a new X-Forwarded-Host Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host

// Create a new Header instance.
newHeader := goheader.NewXForwardedHostHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Forwarded-Host
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXForwardedHostHeader is an example function for NewXForwardedHostHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXForwardedHostHeader("id42.example-cdn.com")
	fmt.Println(header)
}
Output:

func NewXForwardedProtoHeader ΒΆ added in v1.0.0

func NewXForwardedProtoHeader(values ...string) Header

NewXForwardedProtoHeader creates a new X-Forwarded-Proto Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto

// Create a new Header instance.
newHeader := goheader.NewXForwardedProtoHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Forwarded-Proto
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXForwardedProtoHeader is an example function for NewXForwardedProtoHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXForwardedProtoHeader("https")
	fmt.Println(header)
}
Output:

func NewXFrameOptionsHeader ΒΆ added in v1.0.0

func NewXFrameOptionsHeader(values ...string) Header

NewXFrameOptionsHeader creates a new X-Frame-Options Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

// Create a new Header instance.
newHeader := goheader.NewXFrameOptionsHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Frame-Options
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXFrameOptionsHeader is an example function for NewXFrameOptionsHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXFrameOptionsHeader("SAMEORIGIN")
	fmt.Println(header)
}
Output:

func NewXHTTPMethodOverrideHeader ΒΆ added in v1.0.0

func NewXHTTPMethodOverrideHeader(values ...string) Header

NewXHTTPMethodOverrideHeader creates a new X-Http-Method-Override Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Http-Method-Override

// Create a new Header instance.
newHeader := goheader.NewXHTTPMethodOverrideHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Http-Method-Override
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXHTTPMethodOverrideHeader is an example function for NewXHTTPMethodOverrideHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXHTTPMethodOverrideHeader("DELETE")
	fmt.Println(header)
}
Output:

func NewXPoweredByHeader ΒΆ added in v1.0.0

func NewXPoweredByHeader(values ...string) Header

NewXPoweredByHeader creates a new X-Powered-By Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Powered-By

// Create a new Header instance.
newHeader := goheader.NewXPoweredByHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Powered-By
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXPoweredByHeader is an example function for NewXPoweredByHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXPoweredByHeader("PHP/5.4.0")
	fmt.Println(header)
}
Output:

func NewXRedirectByHeader ΒΆ added in v1.0.0

func NewXRedirectByHeader(values ...string) Header

NewXRedirectByHeader creates a new X-Redirect-By Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Redirect-By

// Create a new Header instance.
newHeader := goheader.NewXRedirectByHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Redirect-By
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXRedirectByHeader is an example function for NewXRedirectByHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXRedirectByHeader("WordPress")
	fmt.Println(header)
}
Output:

func NewXRequestIDHeader ΒΆ added in v1.0.0

func NewXRequestIDHeader(values ...string) Header

NewXRequestIDHeader creates a new X-Request-ID Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Request-ID

// Create a new Header instance.
newHeader := goheader.NewXRequestIDHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Request-ID
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXRequestIDHeader is an example function for NewXRequestIDHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXRequestIDHeader("f058ebd6-02f7-4d3f-942e-904344e8cde5")
	fmt.Println(header)
}
Output:

func NewXRequestedWithHeader ΒΆ added in v1.0.0

func NewXRequestedWithHeader(values ...string) Header

NewXRequestedWithHeader creates a new X-Requested-With Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Requested-With

// Create a new Header instance.
newHeader := goheader.NewXRequestedWithHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Requested-With
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXRequestedWithHeader is an example function for NewXRequestedWithHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXRequestedWithHeader("XMLHttpRequest")
	fmt.Println(header)
}
Output:

func NewXUACompatibleHeader ΒΆ added in v1.0.0

func NewXUACompatibleHeader(values ...string) Header

NewXUACompatibleHeader creates a new X-UA-Compatible Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-UA-Compatible

// Create a new Header instance.
newHeader := goheader.NewXUACompatibleHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-UA-Compatible
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXUACompatibleHeader is an example function for NewXUACompatibleHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXUACompatibleHeader("IE=EmulateIE7")
	fmt.Println(header)
}
Output:

func NewXUIDHHeader ΒΆ added in v1.0.0

func NewXUIDHHeader(values ...string) Header

NewXUIDHHeader creates a new X-UIDH Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-UIDH

// Create a new Header instance.
newHeader := goheader.NewXUIDHHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-UIDH
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXUIDHHeader is an example function for NewXUIDHHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXUIDHHeader("...")
	fmt.Println(header)
}
Output:

func NewXWapProfileHeader ΒΆ added in v1.0.0

func NewXWapProfileHeader(values ...string) Header

NewXWapProfileHeader creates a new X-Wap-Profile Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Wap-Profile

// Create a new Header instance.
newHeader := goheader.NewXWapProfileHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-Wap-Profile
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXWapProfileHeader is an example function for NewXWapProfileHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXWapProfileHeader("http://wap.samsungmobile.com/uaprof/SGH-I777.xml")
	fmt.Println(header)
}
Output:

func NewXWebKitCSPHeader ΒΆ added in v1.0.0

func NewXWebKitCSPHeader(values ...string) Header

NewXWebKitCSPHeader creates a new X-WebKit-CSP Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-WebKit-CSP

// Create a new Header instance.
newHeader := goheader.NewXWebKitCSPHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-WebKit-CSP
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXWebKitCSPHeader is an example function for NewXWebKitCSPHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXWebKitCSPHeader("default-src 'self'")
	fmt.Println(header)
}
Output:

func NewXXSSProtectionHeader ΒΆ added in v1.0.0

func NewXXSSProtectionHeader(values ...string) Header

NewXXSSProtectionHeader creates a new X-XSS-Protection Header with the specified values. It accepts a variadic number of strings, where each value represents an item to be added to the Header. More information on the HTTP header can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection

// Create a new Header instance.
newHeader := goheader.NewXXSSProtectionHeader("Example", "Values")
fmt.Println(newHeader.Name) // X-XSS-Protection
fmt.Println(newHeader.Value) // ["Example", "Value"]
Example ΒΆ

ExampleNewXXSSProtectionHeader is an example function for NewXXSSProtectionHeader.

package main

import (
	"fmt"

	"github.com/lindsaygelle/goheader"
)

func main() {
	// Create a new goheader.Header instance.
	header := goheader.NewXXSSProtectionHeader("1; mode=block")
	fmt.Println(header)
}
Output:

Jump to

Keyboard shortcuts

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