I am trying to make a 'put' method with curl everything is working fine and I got the JSON back:
curl -X PUT -d '[{"foo":"more_foo"}]' http://ip:6001/whatever?api_key=whatever
But for some reason when using the python requests
module as follow:
import requests
url = 'http://ip:6001/whatever?api_key=whatever'
a = requests.put(url, data={"foo":"more_foo"})
print(a.text)
print(a.status_code)
I get the following error:
500 Internal Server Error
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
NB: The server is up and running.
The data should be dumped:
or you can use the
json
key instead ofdata
: