This commit is contained in:
邹宗楠
2022-12-06 14:09:27 +08:00
parent 4af9b84f2f
commit 677572a3bd
2 changed files with 7 additions and 3 deletions

View File

@@ -102,6 +102,9 @@ func (a *API) AccessAPI(action string, params map[string]interface{}, body strin
request, _ = http.NewRequest(http.MethodGet, fullURL, nil)
} else {
request, _ = http.NewRequest(http.MethodPost, fullURL, strings.NewReader(body))
if strings.Contains(fullURL, "wxa/generate_urllink") {
request.Header.Set("Content-Type", "application/json")
}
}
request.Close = true // todo try to fix EOF error when accessing weixin api.
return request