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

Update main.go: fix token test

parent faed77bc
Branches
No related tags found
No related merge requests found
Pipeline #5212 failed
......@@ -115,10 +115,10 @@ func main() {
data.Set("grant_type", grantType)
client := &http.Client{}
r, _ := http.NewRequest("POST", tokenUrl, strings.NewReader(data.Encode())) // URL-encoded payload
r.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req, _ := http.NewRequest("POST", tokenUrl, strings.NewReader(data.Encode()))
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
response, err := client.Do(r)
response, err := client.Do(req)
fmt.Println(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