0

I want to send image with raspberry pi 3 model B. Using the requests library, I can send text like this code here. But I don't know how to send image to a server. I need help to send it using requests library. If there another way or another library please tell me.

import requests

payload = {'fisrtName': 'kerolos' , 'lastName': 'Shenouda'}

r = requests.post('https://httpbin.org/post' , data = payload)

print(r.text)
  • Is the server is yours? Do you have acces do the server? – Fredericka Jan 26 '21 at 14:33
  • Welcome to Stack Overflow! Please take the [tour], and read [ask] and [what's on-topic here](/help/on-topic). [Asking on Stack Overflow is not a substitute for doing your own research.](//meta.stackoverflow.com/a/261593/843953) You can find a ton of good resources on the internet, and possibly many questions on SO that deal with similar problems. In your case, a quick google search for [upload image python requests](https://www.google.com/search?q=upload+image+python+requests) gives you tons of good tutorials. – Pranav Hosangadi Jan 26 '21 at 14:56
  • It is my server, so I have access to the server. – Kerolos shenouda Jan 26 '21 at 18:40

0 Answers0