I have an image loaded into a bytearray in a CircuitPython project, and I want to pass it to a POST request using the adafruit_requests library.
My code:
headers={
'Content-Type': 'application/octet-stream',
'Content-Length': str(frame_length),
'Prediction-Key': prediction_key
}
r = requests.request('POST', prediction_endpoint, data=buffer, headers=headers)
When I run this code, I get this error:
......Traceback (most recent call last):
File "code.py", line 85, in <module>
File "adafruit_requests.py", line 242, in request
File "adafruit_requests.py", line 224, in request
TypeError: wrong number of arguments
I cannot for the life of me figure out why! Whats the correct way to send a bytearray as an octet stream to a POST request using CircuitPython?
I've looked at the code in the Adafruit requests repo and the line numbers don't match up with the code, so I don't know what's causing the issue.