Documentation
¶
Index ¶
Constants ¶
View Source
const MaxErrorBodyLen = 200
MaxErrorBodyLen is the maximum length of an error body snippet.
View Source
const MaxResponseBody = 1 << 20
MaxResponseBody is the upper bound on HTTP response body reads (1 MiB).
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
NewClient creates an HTTP client with the given timeout and a default User-Agent. The version string is included in the User-Agent header.
func ReadBody ¶
ReadBody reads up to MaxResponseBody bytes from r. Returns an error if the body exceeds MaxResponseBody.
func TruncateBody ¶
TruncateBody returns up to max bytes of b as a string.
Types ¶
Click to show internal directories.
Click to hide internal directories.