Documentation
¶
Index ¶
- func Bytes(resp *http.Response) ([]byte, error)
- func CheckStatus(resp *http.Response) (*http.Response, error)
- func Decode(resp *http.Response, target any) error
- func Do(req Request) (*http.Response, error)
- func DownloadTo(resp *http.Response, box sandbox.Root, path string) error
- func Get(url string) (*http.Response, error)
- func Json[T any](resp *http.Response, sample T) (T, error)
- func PathEscape(value string) string
- func Post(data any, url string) (*http.Response, error)
- func QueryEscape(value string) string
- func SafeGet(url string) (*http.Response, error)
- func SessionDo(s Session, req Request) (*http.Response, error)
- func SessionGet(s Session, url string) (*http.Response, error)
- func SessionPost(s Session, data any, url string) (*http.Response, error)
- func Text(resp *http.Response) (string, error)
- func URLTemplate(tmpl string, params map[string]string) (string, error)
- func URLWithQuery(baseURL string, params map[string]string) (string, error)
- type Request
- func BasicAuth(req Request, username string, password string) Request
- func BearerAuth(req Request, token string) Request
- func Body(req Request, data any) Request
- func FormData(req Request, data map[string]string) Request
- func Header(req Request, name string, value string) Request
- func MaxBodySize(req Request, limit int64) Request
- func Method(req Request, method string) Request
- func New(url string) Request
- func Retry(req Request, maxAttempts int, delayMs int) Request
- func Timeout(req Request, durationNs int64) Request
- func Transport(req Request, t *http.Transport) Request
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadTo ¶ added in v0.0.5
func PathEscape ¶ added in v0.0.5
func QueryEscape ¶ added in v0.0.5
func URLTemplate ¶ added in v0.0.5
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func BearerAuth ¶
func MaxBodySize ¶ added in v0.0.8
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession() Session
func SessionTimeout ¶
Click to show internal directories.
Click to hide internal directories.