dex/vendor/github.com/mbanzon/simplehttp/helpers.go

18 lines
389 B
Go
Raw Normal View History

2015-08-18 05:57:27 +05:30
package simplehttp
func (r *HTTPRequest) GetResponseFromJSON(v interface{}) error {
response, err := r.MakeGetRequest()
if err != nil {
return err
}
return response.ParseFromJSON(v)
}
func (r *HTTPRequest) PostResponseFromJSON(payload Payload, v interface{}) error {
response, err := r.MakePostRequest(payload)
if err != nil {
return err
}
return response.ParseFromJSON(v)
}