package exported
import "github.com/Azure/azure-sdk-for-go/sdk/internal/exported"
Index ¶
- func HasStatusCode(resp *http.Response, statusCodes ...int) bool
- func Payload(resp *http.Response, opts *PayloadOptions) ([]byte, error)
- func PayloadDownloaded(resp *http.Response) bool
- type PayloadOptions
Functions ¶
func HasStatusCode ¶
HasStatusCode returns true if the Response's status code is one of the specified values. Exported as runtime.HasStatusCode().
func Payload ¶
func Payload(resp *http.Response, opts *PayloadOptions) ([]byte, error)
Payload reads and returns the response body or an error. On a successful read, the response body is cached. Subsequent reads will access the cached value. Exported as runtime.Payload() WITHOUT the opts parameter.
func PayloadDownloaded ¶
PayloadDownloaded returns true if the response body has already been downloaded. This implies that the Payload() func above has been previously called. NOT exported but used by azcore.
Types ¶
type PayloadOptions ¶
type PayloadOptions struct { // BytesModifier receives the downloaded byte slice and returns an updated byte slice. // Use this to modify the downloaded bytes in a payload (e.g. removing a BOM). BytesModifier func([]byte) []byte }
PayloadOptions contains the optional values for the Payload func. NOT exported but used by azcore.
Source Files ¶
- Version
- v1.3.0
- Published
- Apr 4, 2023
- Platform
- windows/amd64
- Imports
- 3 packages
- Last checked
- 6 hours ago –
Tools for package owners.