Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJSONRequest ¶
NewJSONRequest creates an http.Request with JSON body (if payload != nil) and sets Content-Type/Accept to application/json.
func WithTimeout ¶
WithTimeout returns a new context with timeout based on duration. If d <= 0, returns the original ctx.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin wrapper over net/http. It provides sane defaults and small helpers for JSON APIs.
Click to show internal directories.
Click to hide internal directories.