Documentation ¶
Index ¶
- Constants
- func UnmarshalBodyJSON(body io.Reader, target interface{}) error
- type Client
- type DefaultClient
- func (dc *DefaultClient) Delete(url string) *RequestContext
- func (dc *DefaultClient) Get(url string) *RequestContext
- func (dc *DefaultClient) Patch(url, contentType string, body io.Reader) *RequestContext
- func (dc *DefaultClient) PatchJSON(url string, body io.Reader) *RequestContext
- func (dc *DefaultClient) Post(url, contentType string, body io.Reader) *RequestContext
- func (dc *DefaultClient) PostJSON(url string, body io.Reader) *RequestContext
- func (dc *DefaultClient) Put(url, contentType string, body io.Reader) *RequestContext
- func (dc *DefaultClient) PutJSON(url string, body io.Reader) *RequestContext
- type RequestContext
Constants ¶
View Source
const (
ContentTypeJSON = "application/json"
)
Variables ¶
This section is empty.
Functions ¶
func UnmarshalBodyJSON ¶
Types ¶
type Client ¶
type Client interface { Get(url string) *RequestContext Delete(url string) *RequestContext Patch(url, contentType string, body io.Reader) *RequestContext PatchJSON(url string, body io.Reader) *RequestContext Put(url, contentType string, body io.Reader) *RequestContext PutJSON(url string, body io.Reader) *RequestContext Post(url, contentType string, body io.Reader) *RequestContext PostJSON(url string, body io.Reader) *RequestContext }
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() *DefaultClient
func NewHeaderedClient ¶
func NewHeaderedClient(headers map[string]string) *DefaultClient
func NewInsecureClient ¶
func NewInsecureClient(headers map[string]string) *DefaultClient
NewInsecureClient client that skips certificate validate. We should XXX.
func (*DefaultClient) Delete ¶
func (dc *DefaultClient) Delete(url string) *RequestContext
func (*DefaultClient) Get ¶
func (dc *DefaultClient) Get(url string) *RequestContext
func (*DefaultClient) Patch ¶
func (dc *DefaultClient) Patch(url, contentType string, body io.Reader) *RequestContext
func (*DefaultClient) PatchJSON ¶
func (dc *DefaultClient) PatchJSON(url string, body io.Reader) *RequestContext
func (*DefaultClient) Post ¶
func (dc *DefaultClient) Post(url, contentType string, body io.Reader) *RequestContext
func (*DefaultClient) PostJSON ¶
func (dc *DefaultClient) PostJSON(url string, body io.Reader) *RequestContext
func (*DefaultClient) Put ¶
func (dc *DefaultClient) Put(url, contentType string, body io.Reader) *RequestContext
func (*DefaultClient) PutJSON ¶
func (dc *DefaultClient) PutJSON(url string, body io.Reader) *RequestContext
type RequestContext ¶
type RequestContext struct { Client *http.Client Method string Headers map[string]string RequestBody io.Reader URL string }
func (*RequestContext) Body ¶
func (r *RequestContext) Body() (io.ReadCloser, int, error)
func (*RequestContext) JSON ¶
func (r *RequestContext) JSON(target interface{}) (int, error)
func (*RequestContext) Status ¶
func (r *RequestContext) Status() (int, error)
Click to show internal directories.
Click to hide internal directories.