Im hitting a strange issue when running two identical requests, one from curl and one via the python requests package. The python requests is responding 200 and the curl is responding with 404. What possible reasons would there be for curl to respond with a 404 error?
Curl:
curl https://dummmy.eu/endpoint
-X POST
-H "Content-Type:application/x-www-form-urlencoded"
-d "refresh_token=xxxxxxxx"
-d "grant_type=refresh_token"
-d "client_id=xxxxxxxx"
-d "client_secret=xxxxxxxx"
Python:
import requests
url = "https://dummy.eu/endpoint"
data ={"Content-Type": "application/x-www-form-urlencoded",
"refresh_token" : "xxxxxxxx",
"grant_type" : "refresh_token",
"client_id" : "xxxxxxxx",
"client_secret" : "xxxxxxxx"
}
response = requests.post(url,data=data)
print(response)
print(response.text)
I have checked every credential and the url multiple times. Both formats were taken from vendor documentation so should be correct.
New contributor
mcmapple is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.