http

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAuthorization = "authorization"
	HeaderCacheControl  = "cache-control"
	HeaderContentType   = "content-type"
	HeaderCookie        = "cookie"
	HeaderLocation      = "location"
	HeaderPragma        = "pragma"
	HeaderSetCookie     = "set-cookie"

	HeaderCacheControlNoCache = "no-cache"

	HeaderContentTypeFormURLEncoded = "application/x-www-form-urlencoded"

	HeaderPragmaNoCache = "no-cache"

	HeaderSetCookieSecure         = "Secure"
	HeaderSetCookieHTTPOnly       = "HttpOnly"
	HeaderSetCookieSameSiteStrict = "SameSite=Strict"
	HeaderSetCookieSameSiteLax    = "SameSite=Lax"
	HeaderSetCookieMaxAge         = "Max-Age"
)

Variables

This section is empty.

Functions

func BasicAuthHeader

func BasicAuthHeader(id string, secret string) string

func DecodeCookiesHeader

func DecodeCookiesHeader(headerValue string) map[string]string

DecodeCookiesHeader parses the value of the Cookie header to find all the cookies set. It returns a map of name->value for all the found valid cookies.

func EncodeCookieHeader

func EncodeCookieHeader(name string, value string, directives []string) string

EncodeCookieHeader builds the value of the Set-Cookie header from the given cookie name, value and directives.

func GetPathQueryFragment

func GetPathQueryFragment(fullPath string) (path string, query string, fragment string)

GetPathQueryFragment splits the given path into path, query, and fragment. See https://tools.ietf.org/html/rfc3986#section-3.4 and https://tools.ietf.org/html/rfc3986#section-3.5 for more information.

Types

This section is empty.

Jump to

Keyboard shortcuts

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