Skip to content
Snippets Groups Projects
Commit 891b08b0 authored by Yoan VALLET's avatar Yoan VALLET
Browse files

Update main: use http.PostForm instead of http.Do

parent d05317c2
Branches
No related tags found
No related merge requests found
Pipeline #5709 passed
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment