You want to pass in JSON encoded data. See the API documentation:
Remember — All post bodies must be JSON encoded data (no form data).
The requests library makes this trivially easy:
headers = {"W-Token": "Ilovemyboss"}
data = [
{
'url': '/rest/shifts',
'params': {'user_id': 0, 'other_stuff': 'value'},
'method': 'post',
},
{
'url': '/rest/shifts',
'params': {'user_id': 1,'other_stuff': 'value'},
'method':'post',
},
]
requests.post(url, json=data, headers=headers)
By using the json keyword argument the data is encoded to JSON for you, and the Content-Type header is set to application/json.