Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to post files to remote server? #324

Open
thugbobby opened this issue Aug 11, 2020 · 1 comment
Open

how to post files to remote server? #324

thugbobby opened this issue Aug 11, 2020 · 1 comment

Comments

@thugbobby
Copy link

Hello. I want to post some files to remote server.But I have not found how to post.
In python, I can post file like this:

import requests
payload = {}
files = [
  ('uploads2', open('/D:/cat.png','rb')),
]
headers= {}
response = requests.request("POST", url, headers=headers, data = payload, files = files)
print(response.text.encode('utf8'))

but in micropython, what should I do? the urequests doesn`t have parameter files.

Thanks for your help!

@k4m454k
Copy link

k4m454k commented Aug 12, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants