I am trying to use request to PUT some data as such,
r = requests.put(
url,
data={'tiles': []},
headers={'x-auth-token': token}
)
However, tiles is not sent if it is just an empty list. tiles only appears when the data is not empty. I checked this with http://httpbin.org/put also.
Does anyone have any ideas how to put empty data?
Naturally I figured it out immediately after asking. I wanted to use json inplace of data.
r = requests.put(
url,
json={'tiles': []},
headers={'x-auth-token': token}
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With