diff --git a/main.go b/main.go index bb40c34f7b6174fd096b792a43b347a6f78afe01..3fcdcedcaadcdbd064b302d3abb97180a3c4a62b 100644 --- a/main.go +++ b/main.go @@ -174,13 +174,9 @@ func main() { data.Set("refresh_token", refreshToken) data.Set("grant_type", "refresh_token") } - - client := &http.Client{} - req, _ := http.NewRequest("POST", tokenUrl, strings.NewReader(data.Encode())) - req.Header.Add("Content-Type", "application/x-www-form-urlencoded") fmt.Println(time.Now().Format("2006-01-02 15:04:05"), "- Send request to token endpoint", tokenUrl) - response, err := client.Do(req) + response, err := http.PostForm(tokenUrl, data) fmt.Println(time.Now().Format("2006-01-02 15:04:05"), "- Endpoint response with status", response.Status) if err != nil { fmt.Println(err)