This is my code:
import requests
url = 'https://api'
files=[('file',('image.png',open('/C:/Users/Swarnitha/Downloads/image.png','rb'),'image/png'))]
#files = {"file":open('/C:/Users/Swarnitha/Downloads/image.png','rb')}
response = requests.post(url, files=files)
In windows I am sending the path of the file like this. I am getting error as:
Traceback (most recent call last):
File "test.py", line 66, in <module>
('file',('image.png',open('/C:/Users/Swarnitha/Downloads/image.png','rb'),'image/png'))
FileNotFoundError: [Errno 2] No such file or directory: '/C:/Users/Swarnitha/Downloads/image.png'
Usually I use to run the same code in ubuntu and give file path from ubuntu software,it use to work.
Please give me solution for this