Why next two methods of obtaining authentication token are not equivalent?
First one is using curl in terminal:
curl -X POST "http://myurl.com" -d "grant_type=password&username=me&password=mypass&client_secret=123&client_id=456"
This request successfully returns the token. If I use requests library for python:
import requests
url = 'http://myurl.com'
query_args = { "grant_type":"password",
"username":'me',
"password":'mypass',
"client_secret":'123',
'client_id':'456'}
r = requests.get(url, data=query_args)
the result I get is r.status_code is 404, so I cannot get the token.
Why the first method works and the second does not?
Also, how to make the second approach work?
Thank you!
-din curl, which means 'data'.urlin python code