Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeResponseBody(p *Params, response interface{}) error
- func Get(uri string, params map[string][]string, response interface{}) (*http.Response, error)
- func Post(uri string, payload, response interface{}) (*http.Response, error)
- func Request(params *Params, payload interface{}, body interface{}) error
- func RequestErr(p *Params, payload interface{}, body interface{}, e error) (error, bool)
- func StatusCodeInBounds(code int) bool
- type CustomPayload
- type Error
- type MultipartBuffer
- type Params
Constants ¶
View Source
const ( TypeJSONUTF8 = "application/json; charset=UTF-8" TypeJSON = "application/json" )
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
View Source
var ErrStatusBounds = errors.New("out of bounds http status code")
Functions ¶
func DecodeResponseBody ¶
func Request ¶
Request makes an http request with params and optional payload to specified Url in params.Url. It will save respond body value into body.
func RequestErr ¶
func StatusCodeInBounds ¶
Types ¶
type CustomPayload ¶
type MultipartBuffer ¶
MultipartWriter wraps bytes.Buffer to make it a custom payload.
func (*MultipartBuffer) ContentType ¶
func (w *MultipartBuffer) ContentType() string
Click to show internal directories.
Click to hide internal directories.