Minor changes
This commit is contained in:
parent
41d7f514e3
commit
7c236e105c
1 changed files with 3 additions and 4 deletions
7
api.go
7
api.go
|
|
@ -72,14 +72,13 @@ func (s *Scraper) GetGuestToken() error {
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
content, _ := ioutil.ReadAll(resp.Body)
|
||||
return fmt.Errorf("response status %s: %s", resp.Status, content)
|
||||
}
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return fmt.Errorf("response status %s: %s", resp.Status, body)
|
||||
}
|
||||
|
||||
var jsn map[string]interface{}
|
||||
if err := json.Unmarshal(body, &jsn); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue