http

package
v0.0.0-...-e433ced Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = newClient().StandardClient()

Functions

func GetWithAuth

func GetWithAuth(ctx context.Context, url, auth string) (*http.Response, error)

func GetWithContext

func GetWithContext(ctx context.Context, url string) (*http.Response, error)

func GetWithHeader

func GetWithHeader(ctx context.Context, url string, header http.Header) (*http.Response, error)

func PostForValues

func PostForValues(_url, contentType string, body io.Reader) (url.Values, error)

PostForValues issues a POST to the specified URL and returns the response body as url.Values.

func Put

func Put(ctx context.Context, url string, contentType string, body io.Reader) (*http.Response, error)

Put issues a PUT to the specified URL.

Caller should close resp.Body when done reading from it.

If the provided body is an io.Closer, it is closed after the request.

To set custom headers, use NewRequest and DefaultClient.Do.

See the Client.Do method documentation for details on how redirects are handled.

func RemoveQueryParam

func RemoveQueryParam(qurl string) string

Types

type Header = http.Header

Jump to

Keyboard shortcuts

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