sender

package
v4.15.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doer

type Doer struct {
	// contains filtered or unexported fields
}

func NewDoer

func NewDoer(client *http.Client, userAgent string) *Doer

NewDoer Creates a new Doer.

func (*Doer) Get

func (d *Doer) Get(url string, response interface{}) (*http.Response, error)

Get performs a GET request with a proper User-Agent string. If "response" is not provided, callers should close resp.Body when done reading from it.

func (*Doer) Head

func (d *Doer) Head(url string) (*http.Response, error)

Head performs a HEAD request with a proper User-Agent string. The response body (resp.Body) is already closed when this function returns.

func (*Doer) Post

func (d *Doer) Post(url string, body io.Reader, bodyType string, response interface{}) (*http.Response, error)

Post performs a POST request with a proper User-Agent string. If "response" is not provided, callers should close resp.Body when done reading from it.

type RequestOption

type RequestOption func(*http.Request) error

Jump to

Keyboard shortcuts

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