req

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is an endpoint spoken to under a timeout, since the default client waits forever.

func New

func New(timeout time.Duration) *Client

New builds a client that gives up on a request after the given wait.

func (*Client) Form

func (self *Client) Form(ctx context.Context, address string, form url.Values, target any) error

Form posts a form and reads the JSON answer into target.

func (*Client) Stream

func (self *Client) Stream(ctx context.Context, address string, body any, header http.Header) (io.ReadCloser, error)

Stream posts a JSON body and hands back the response, which is the caller's to close.

Jump to

Keyboard shortcuts

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