Documentation
¶
Index ¶
- func CertificateVerifyFailed(err error) bool
- func EnvCABundle() string
- func PathURL(u *url.URL) string
- func SSLErrorText(err error) string
- func VerifyTLSConfig(base *tls.Config, bundle string, dir bool) *tls.Config
- type Error
- type OSError
- type Response
- func Send(ctx context.Context, base *http.Transport, t Timeout, req *http.Request) (*Response, error)
- func SendNoEnv(ctx context.Context, base *http.Transport, t Timeout, req *http.Request) (*Response, error)
- func SendNoRedirects(ctx context.Context, base *http.Transport, t Timeout, req *http.Request) (*Response, error)
- type Timeout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertificateVerifyFailed ¶
Whether a TLS failure is a certificate the client refused, every chain, name and validity check the handshake runs
func EnvCABundle ¶
func EnvCABundle() string
Verify bundle requests merges from the environment, REQUESTS_CA_BUNDLE then CURL_CA_BUNDLE, empty keeping the default
func PathURL ¶
PathURL is PreparedRequest.path_url, the path with its query and a slash for an empty path
func SSLErrorText ¶
str of the ssl module exception a failed handshake raises, the strerror its repr carries
Types ¶
type Error ¶
type Error struct {
Class string
Text string
// Reason is the urllib3 class under a MaxRetryError and DNS marks a name resolution cause
Reason string
DNS bool
Err error
}
Error is a raised requests exception, Class its class name and Text its str
type OSError ¶
type OSError struct{ Text string }
OSError is an OSError requests raises itself, outside the RequestException family its callers catch
func (*OSError) PyTypeName ¶
Python exception class name the error stands for
type Response ¶
type Response struct {
Status int
Header http.Header
Body []byte
// Final URL after redirects, the url raise_for_status names
URL string
}
Response is one answer read whole
func Send ¶
func Send(ctx context.Context, base *http.Transport, t Timeout, req *http.Request) (*Response, error)
Send performs one requests call, every transport failure raised as the requests exception it maps to
func SendNoEnv ¶
func SendNoEnv(ctx context.Context, base *http.Transport, t Timeout, req *http.Request) (*Response, error)
SendNoEnv is Send for a client that is not a requests session trusting its environment, the verify bundle variables left unread
func SendNoRedirects ¶
func SendNoRedirects(ctx context.Context, base *http.Transport, t Timeout, req *http.Request) (*Response, error)
SendNoRedirects is Send with allow_redirects False, a redirect answer returned as the response
func (*Response) RaiseForStatus ¶
HTTPError requests raise_for_status raises for a client or server error status, nil for any other