| @@ -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() | |||