Documentation
¶
Overview ¶
Package request provides a small generic helper for sending HTTP requests and decoding JSON responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶ added in v0.1.1
type Auth interface {
// contains filtered or unexported methods
}
Auth is implemented by any value that can apply credentials to an outgoing http.Request (e.g. BasicAuth).
type BearerAuth ¶ added in v0.1.1
type BearerAuth struct {
Token string
}
BearerAuth adds an Authorization: Bearer <token> header to the request.
type Options ¶ added in v0.1.1
Options describes a single HTTP request.
Body can be any value that json.Marshal can handle. If it is nil, an empty request body is sent. If it is already a []byte or io.Reader, it is used as-is (without re-encoding).
Headers is merged on top of the Content-Type that the package sets for JSON bodies, so callers can override it.
Click to show internal directories.
Click to hide internal directories.