Port over API bits from #962 (#965)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-02-25 12:39:51 -05:00
1 parent 3ab8bb03de
commit ea23737258
18 files changed
+101 -407

No files matched your search

+5
View File
@@ -22,6 +22,11 @@ func (r *Response) HttpResponse() *http.Response {
return r.resp
}
// StatusCode returns the underlying HTTP status code
func (r *Response) StatusCode() int {
return r.resp.StatusCode
}
func (r *Response) Decode(inStruct interface{}) (*Error, error) {
if r == nil || r.resp == nil {
return nil, fmt.Errorf("nil response, cannot decode")