Documentation ¶
Index ¶
- Constants
- func DecodeRespBody(resp *http.Response, dst any) error
- func IsUnsupportedContentTypeError(err error) bool
- type BodyEncodeFunc
- type Client
- func (c *Client) AddHeader(key, value string) *Client
- func (c *Client) AddQuery(key, value string) *Client
- func (c *Client) Connect(url string) *Request
- func (c *Client) Delete(url string) *Request
- func (c *Client) Get(url string) *Request
- func (c *Client) Head(url string) *Request
- func (c *Client) Options(url string) *Request
- func (c *Client) Patch(url string) *Request
- func (c *Client) Post(url string) *Request
- func (c *Client) Put(url string) *Request
- func (c *Client) Request(url, method string) *Request
- func (c *Client) SetHeader(key, value string) *Client
- func (c *Client) SetQuery(key, value string) *Client
- func (c *Client) Trace(url string) *Request
- type Request
- func (r *Request) AddHeader(key, value string) *Request
- func (r *Request) AddQuery(key, value string) *Request
- func (r *Request) Call(ctx context.Context) *Response
- func (r *Request) SetBody(body any) *Request
- func (r *Request) SetBodyEncodeFunc(fn BodyEncodeFunc) *Request
- func (r *Request) SetHeader(key, value string) *Request
- func (r *Request) SetQuery(key, value string) *Request
- type Response
- type UnsupportedContentTypeError
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" ContentTypeTextPlain = "text/plain" ContentTypeTextPlainCharacterUTF8 = "text/plain; charset=utf-8" ContentTypeApplicationJSON = "application/json" ContentTypeApplicationJSONCharacterUTF8 = "application/json; charset=utf-8" ContentTypeApplicationXML = "application/xml" ContentTypeApplicationXMLCharacterUTF8 = "application/xml; charset=utf-8" ContentTypeTextXML = "text/xml" ContentTypeTextXMLCharacterUTF8 = "text/xml; charset=utf-8" ContentTypeApplicationOctetStream = "application/octet-stream" ContentTypeMultipartFormData = "multipart/form-data" ContentTypeFormURLEncoded = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func IsUnsupportedContentTypeError ¶ added in v0.3.0
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() *Client
func NewWithClient ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) SetBodyEncodeFunc ¶
func (r *Request) SetBodyEncodeFunc(fn BodyEncodeFunc) *Request
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func (*Response) DecodeRespBody ¶
type UnsupportedContentTypeError ¶ added in v0.3.0
type UnsupportedContentTypeError struct {
ContentType string
}
func (*UnsupportedContentTypeError) Error ¶ added in v0.3.0
func (e *UnsupportedContentTypeError) Error() string
Click to show internal directories.
Click to hide internal directories.