urllib / urequests for Micropython
Posted: Thu Oct 29, 2015 1:23 pm
UPDATE for moderators: urllib.urequest and urequests modules are now available in the MicroPython's standard library, micropython-lib:
I couldn't find a urllib library for Micropython, so I have written one.
Available at https://github.com/lucien2k/wipy-urllib
Currently it supports:
1. HTTP GET and POST
2. 301 and 302 redirects
It works in a similar way to urllib:
More work required, but this is a starting point. I am mainly aiming to use it for APIs (pushing data etc).
Update 30th October:
- Fixed a few of the issues that were causing memory problems. It is important to note that memory is limited on the wipy though, so you may run into problems if you try to read bigger sites.
- Thanks to Damien and Daniel for helping with the problems I ran into.
Update 8th November:
- Added a new version called urequests that works in a similar way to the python-requests library.
- Available at https://github.com/lucien2k/wipy-urllib ... equests.py / https://pypi.python.org/pypi/urequests
- https://github.com/micropython/micropyt ... b.urequest
- https://github.com/micropython/micropyt ... /urequests
I couldn't find a urllib library for Micropython, so I have written one.
Available at https://github.com/lucien2k/wipy-urllib
Currently it supports:
1. HTTP GET and POST
2. 301 and 302 redirects
It works in a similar way to urllib:
Code: Select all
import urllib
f=urllib.urlopen('http://www.microsoft.com')
f.code
f.read()
Update 30th October:
- Fixed a few of the issues that were causing memory problems. It is important to note that memory is limited on the wipy though, so you may run into problems if you try to read bigger sites.
- Thanks to Damien and Daniel for helping with the problems I ran into.
Update 8th November:
- Added a new version called urequests that works in a similar way to the python-requests library.
- Available at https://github.com/lucien2k/wipy-urllib ... equests.py / https://pypi.python.org/pypi/urequests