http

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ControlClientGenerator = GenControlHTTPSClient

Functions

func AsJSON added in v0.7.0

func AsJSON(req *http.Request)

func Delete

func Delete(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error

Delete perform a request using Request with the DELETE method

func GenControlHTTPSClient added in v0.7.0

func GenControlHTTPSClient() *http.Client

func Get

func Get(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error

Get perform a request using Request with the GET method

func Post

func Post(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error

Post perform a request using Request with the POST method

func Put

func Put(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error

Put perform a request using Request with the PUT method

func Reason

func Reason(r *http.Response) (string, error)

Reason returns the reason phrase embedded within the JSON error body, or an error if no reason can be extracted

func Request

func Request(method string, url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuners ...func(*http.Request)) error

Request will perform the request to the given url and method sending the content of the given reader as the body and writing all the contents of the response to the given writer. The reader and writer are optional.

Types

This section is empty.

Jump to

Keyboard shortcuts

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