httpheaders

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderUserAgent     = "User-Agent"
	HeaderAuthorization = "Authorization"
	HeaderAccept        = "Accept"
	HeaderContentType   = "Content-Type"

	MediaTypeJSON        = "application/json"
	MediaTypeEventStream = "text/event-stream"

	BearerAuthorizationPrefix = "Bearer "
)

Variables

This section is empty.

Functions

func SetAccept

func SetAccept(req *http.Request, value string)

SetAccept sets the Accept header on the request.

func SetAcceptEventStream

func SetAcceptEventStream(req *http.Request)

SetAcceptEventStream sets the Accept header to text/event-stream.

func SetAcceptJSON

func SetAcceptJSON(req *http.Request)

SetAcceptJSON sets the Accept header to application/json.

func SetBearerAuthorization

func SetBearerAuthorization(req *http.Request, token string)

SetBearerAuthorization sets an Authorization header with a Bearer token.

func SetContentType

func SetContentType(req *http.Request, value string)

SetContentType sets the Content-Type header on the request.

func SetContentTypeJSON

func SetContentTypeJSON(req *http.Request)

SetContentTypeJSON sets the Content-Type header to application/json.

func SetUserAgent

func SetUserAgent(req *http.Request, userAgent string)

SetUserAgent sets the User-Agent header on the request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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