Okay, I give up. I am trying to post the contents of a file that contains JSON. The contents of the file look like this:
{
\"id”:99999999,
You need to parse the JSON, and pass that the body like so:
import requests
import json
json_data = None
with open('example.json') as json_file:
json_data = json.load(json_file)
auth=('token', 'example')
r = requests.post('https://api.example.com/api/dir/v1/accounts/9999999/orders', json=json_data, auth=auth)