requests

package
v7.13.12 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPClient = &http.Client{Transport: &userAgentTransport{
	next:      DefaultTransport,
	userAgent: "oauth2-proxy/" + version.VERSION,
}}
View Source
var DefaultTransport = http.DefaultTransport

Functions

This section is empty.

Types

type Builder

type Builder interface {
	WithContext(context.Context) Builder
	WithBody(io.Reader) Builder
	WithMethod(string) Builder
	WithHeaders(http.Header) Builder
	SetHeader(key, value string) Builder
	Do() Result
}

Builder allows users to construct a request and then execute the request via Do(). Do returns a Result which allows the user to get the body, unmarshal the body into an interface, or into a simplejson.Json.

func New

func New(endpoint string) Builder

New provides a new Builder for the given endpoint.

type Result

type Result interface {
	Error() error
	StatusCode() int
	Headers() http.Header
	Body() []byte
	UnmarshalInto(interface{}) error
	UnmarshalSimpleJSON() (*simplejson.Json, error)
}

Result is the result of a request created by a Builder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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