Преглед изворни кода

added networking access fatal error message

master
Patrick Peng Sun пре 8 година
родитељ
комит
1a5557d04b
1 измењених фајлова са 3 додато и 0 уклоњено
  1. +3
    -0
      accessToken.go

+ 3
- 0
accessToken.go Прегледај датотеку

@@ -70,8 +70,11 @@ func renewAuthToken() (AuthToken, error) {
//url := "http://vimeo.com/api/v2/brad/info.json"
url := fmt.Sprintf("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", APIConfig.Appid, APIConfig.AppSecret)
var myClient = &http.Client{Timeout: 20 * time.Second}
log.Println("renew access token from Internet api.weixin.qq.com")
r, err := myClient.Get(url)
if err != nil {
log.Fatal("http access api.weixin.qq.com failed")
log.Fatal(err)
return AuthToken{}, err
}
defer r.Body.Close()

Loading…
Откажи
Сачувај