Documentation ¶
Overview ¶
Package httphelper contains net/http package helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorOptionWithObject ¶ added in v0.5.0
func ErrorOptionWithObject() func(o *ErrorOptions)
ErrorOptionWithObject turns on Error's Object JSON deserialization from HTTP response body.
Types ¶
type Error ¶ added in v0.5.0
type Error[E any] struct { StatusCode int `json:"status_code"` Status string `json:"status"` Object E `json:"object,omitempty"` }
Error represents a HTTP error. Object (if turned on in options) is deserialized from JSON read from HTTP response body (if any).
func NewError ¶ added in v0.5.0
NewError creates Error from http.Response.
type ErrorOptions ¶ added in v0.5.0
type ErrorOptions struct {
// contains filtered or unexported fields
}
ErrorOptions contains Error options.
Click to show internal directories.
Click to hide internal directories.