mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-22 14:55:16 +00:00
F
This commit is contained in:
@@ -3,7 +3,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"errors"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -123,7 +123,9 @@ func (client *Client) Call(service, endpoint string, request, response interface
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fmt.Println(string(body))
|
if !(resp.StatusCode >= 200 && resp.StatusCode < 300) {
|
||||||
|
return errors.New(string(body))
|
||||||
|
}
|
||||||
return unmarshalResponse(body, response)
|
return unmarshalResponse(body, response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user