I want to upload a picture in python. This doesn't work without specifying the content-length. Sadly I don't know how to calculate it manually nor automatically. I tried to encode the picture and adding the body and then send the content-length. No success. I hope u can help me. I use python requests.
payload = {'num_media_pending': '0',
'type': 'photo'}