added create date calculator for channel.
This commit is contained in:
5
http.go
5
http.go
@@ -2,6 +2,7 @@ package revoltgo
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
@@ -26,6 +27,10 @@ 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user