customhttpclient

package
v0.179.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ContentEncodingHeader = "Content-Encoding"
	AcceptEncodingHeader  = "Accept-Encoding"
)
View Source
const (
	URL           = "url"
	METHOD        = "method"
	BODY          = "body"
	HEADER        = "header"
	QUERYPARAMS   = "query_params"
	URLENCODEBODY = "url_encode_body"
)

Variables

This section is empty.

Functions

func Do

func Do(client *http.Client, ctx context.Context, requestInput []byte, out io.Writer) (err error)

func DoWithStatus

func DoWithStatus(client *http.Client, ctx context.Context, requestInput []byte, out io.Writer) (int, error)

func SetTag added in v0.138.0

func SetTag(r *http.Request, tag RequestTag)

SetTag tags an outgoing request with the given tag

Types

type RequestTag added in v0.138.0

type RequestTag string

RequestTag is used to tag requests we trigger from WunderGraph and avoid circular dependencies

const (
	// RequestTagUserInfo indicates the request is fetching
	// the userInfo endpoint for token based authentication
	RequestTagUserInfo RequestTag = "userInfo"
	// RequestTagNone indicates the request had no valid tag
	RequestTagNone RequestTag = ""
)

func Tag added in v0.138.0

func Tag(r *http.Request) RequestTag

Tag retrieves the tag for an incoming request. If the header missing or present but with an unknown value, it returns RequestTagNone.

Jump to

Keyboard shortcuts

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