web

package
v0.0.0-...-4308b5e Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPClient = &http.Client{
	Timeout: 3 * time.Second,
}

The default HTTP client to use when fetching a URL.

Functions

func Get

func Get(url string) (*http.Response, error)

Get performs a HTTP GET of a URL using the default HTTP client.

func GetWithClient

func GetWithClient(client *http.Client, url string, headers map[string]string) (*http.Response, error)

GetWithClient performs a HTTP GET of a URL with custom headers using the supplied HTTP client.

func GetWithHeaders

func GetWithHeaders(url string, headers map[string]string) (*http.Response, error)

GetWithHeaders performs a HTTP GET of a URL using the default HTTP client and passing in the supplied headers.

func Post

func Post(url string, body io.Reader) (*http.Response, error)

Post performs a HTTP POST to a URL using the supplied body and the default HTTP client.

func PostWithClient

func PostWithClient(client *http.Client, url string, body io.Reader) (*http.Response, error)

PostWithClient performs a HTTP POST to a URL using the supplied body and HTTP client.

func Put

func Put(url string, body io.Reader) (*http.Response, error)

Put performs a HTTP PUT to a URL using the supplied body and the default HTTP client.

func PutWithClient

func PutWithClient(client *http.Client, url string, body io.Reader) (*http.Response, error)

PutWithClient performs a HTTP PUT to a URL using the supplied body and HTTP client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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