I have a Python script that is using the requests module to post JSON to an API. However, I am posting a hash that uses hex. I'm running into an error when I use the following code:
r = requests.post('apiurl.com/do/stuff', json={"key": '0052ccca'})
The response is a 400 error:
{"message": "Could not parse request body into json: Unrecognized token
\'k0052ccca\': was expecting (\'true\', \'false\' or \'null\')\n at
[Source: [B@410c3139; line: 2, column: 23]"}
In this answer the recommendation is to treat the leading zeros as a string, but I'm already doing that and still getting an error.