httphelper

package
v0.0.82 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const HeaderHost = "Host"
View Source
const HeaderXForwardedFor = "X-Forwarded-For"
View Source
const HeaderXForwardedHost = "X-Forwarded-Host"

Variables

This section is empty.

Functions

func DumpResponse

func DumpResponse(resp *http.Response) error

DumpResponse dumps the body of the specified response to stdout

func GetBaseURL added in v0.0.72

func GetBaseURL(req *http.Request) string

func GetHeaders added in v0.0.65

func GetHeaders(keyValues map[string]string) http.Header

func GetURL added in v0.0.65

func GetURL(path string, params map[string]string) (*url.URL, error)

func HasContentType added in v0.0.65

func HasContentType(resp *http.Response, contentType string) bool

func IsSuccessResponse added in v0.0.65

func IsSuccessResponse(resp *http.Response) bool

func NewRequest added in v0.0.65

func NewRequest(method string, path string, params map[string]string, headers map[string]string, body io.Reader) (*http.Request, error)

func SetBearerTokenHeader

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

SetBearerTokenHeader sets the Authorization header with the specified bearer token

Types

This section is empty.

Jump to

Keyboard shortcuts

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