added create channel functions.
This commit is contained in:
8
http.go
8
http.go
@@ -27,10 +27,6 @@ func (c Client) Request(method, path string, data []byte) ([]byte, error) {
|
||||
return []byte{}, err
|
||||
}
|
||||
|
||||
if !(resp.StatusCode >= 200 && resp.StatusCode < 300) {
|
||||
return []byte{}, fmt.Errorf(resp.Status)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
|
||||
@@ -38,5 +34,9 @@ func (c Client) Request(method, path string, data []byte) ([]byte, error) {
|
||||
return []byte{}, err
|
||||
}
|
||||
|
||||
if !(resp.StatusCode >= 200 && resp.StatusCode < 300) {
|
||||
return []byte{}, fmt.Errorf("%s: %s", resp.Status, body)
|
||||
}
|
||||
|
||||
return body, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user