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?
'tiles': []? Why are you setting it to an empty list? A list is seen as 0 or more values for the parameter, so'tiles': ['foo', 'bar']becomestiles=fooandtiles=bar.