httputil

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseResponse added in v1.5.0

func CloseResponse(resp *http.Response)

CloseResponse closes the response's body. But reads at least some of the body so if it's small the underlying TCP connection will be re-used. No need to check for errors: if it fails, the Transport won't reuse it anyway.

func RetriableStatus added in v1.2.0

func RetriableStatus(statusCode int) bool

RetriableStatus returns true if the HTTP status code should be retried.

We consider retriable status code:
	* 5xx - all server errors
	* 408 - request timeout
	* 429 - too many requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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