httputil

package
v0.0.0-...-6709811 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadRawResponse

func ReadRawResponse[T any](response *http.Response) (*T, error)

Reads the raw HTTP response and attempt to convert it into the specified type Typically used in conjunction with runtime.WithCaptureResponse(...) to get access to the underlying HTTP response of the SDK API call.

func RetryAfter

func RetryAfter(resp *http.Response) time.Duration

RetryAfter returns the retry after duration from the response headers. If none exists, a zero value is returned. Headers are checked in the following order: retry-after-ms, x-ms-retry-after-ms, retry-after

func TlsEnabledTransport

func TlsEnabledTransport(derBytes string) (*http.Transport, error)

TlsEnabledTransport returns a http.Transport that has TLS configured to use the provided Base64 DER-encoded certificate. The returned http.Transport inherits defaults from http.DefaultTransport.

Types

This section is empty.

Jump to

Keyboard shortcuts

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