Documentation ¶
Index ¶
- Constants
- func UseApiError(status int) bool
- type Client
- type Request
- func (r *Request) Delete() *Response
- func (r *Request) Do(method string) *Response
- func (r *Request) Get() *Response
- func (r *Request) Head() *Response
- func (r *Request) Options() *Response
- func (r *Request) Patch() *Response
- func (r *Request) Post() *Response
- func (r *Request) Put() *Response
- func (r *Request) SetBody(mtype *mediatype.MediaType, input interface{}) error
- type Response
Constants ¶
View Source
const ( HeadMethod = "HEAD" GetMethod = "GET" PostMethod = "POST" PutMethod = "PUT" PatchMethod = "PATCH" DeleteMethod = "DELETE" OptionsMethod = "OPTIONS" )
Variables ¶
This section is empty.
Functions ¶
func UseApiError ¶
Types ¶
type Client ¶
type Client struct { HttpClient *http.Client Endpoint *url.URL Header http.Header Query url.Values }
A Client wraps an *http.Client with a base url Endpoint and common header and query values.
func NewFromString ¶
NewFromString returns a new Client given a string URL and an optional client.
func (*Client) ResolveReference ¶
ResolveReference resolves a URI reference to an absolute URI from an absolute base URI. It also merges the query values.
type Request ¶
type Response ¶
type Response struct { ResponseError error MediaType *mediatype.MediaType MediaHeader *mediaheader.MediaHeader BodyClosed bool *http.Response // contains filtered or unexported fields }
func ResponseError ¶
func (*Response) IsApiError ¶
Directories ¶
Path | Synopsis |
---|---|
Package hypermedia provides helpers for parsing hypermedia links in resources and expanding the links to make further requests.
|
Package hypermedia provides helpers for parsing hypermedia links in resources and expanding the links to make further requests. |
Package mediatype contains helpers for parsing media type strings.
|
Package mediatype contains helpers for parsing media type strings. |
Click to show internal directories.
Click to hide internal directories.