http

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpResponseBodyToDisk

func DumpResponseBodyToDisk(res *http.Response) (path string, err error)

Types

type Client

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

func NewClient

func NewClient(options ...Option) *Client

func (*Client) Client

func (c *Client) Client() *http.Client

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, url string) (*http.Response, error)

func (*Client) RoundTrip

func (c *Client) RoundTrip(req *http.Request) (*http.Response, error)

func (*Client) WithOptions

func (c *Client) WithOptions(options ...Option) *Client

type Middleware

type Middleware func(*http.Request) (*http.Response, error)

type MiddlewareFunc

type MiddlewareFunc func(Middleware) Middleware

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithMiddleware

func WithMiddleware(middleware MiddlewareFunc, options ...bool) Option

func WithSkipRedirects

func WithSkipRedirects() Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

func WithUserAgent

func WithUserAgent(userAgent string) Option

type Request

type Request = http.Request

type Response

type Response = http.Response

Jump to

Keyboard shortcuts

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