httpheaders

package
v1.28.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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