kopia lustrzana https://github.com/micropython/micropython-lib
urequests: Add example_xively.py as very basic example.
The main purpose is actually to show the need to call .close().pull/68/merge
rodzic
577457dbdd
commit
d0c6ae0b31
|
@ -0,0 +1,16 @@
|
|||
try:
|
||||
import urequests as requests
|
||||
except ImportError:
|
||||
import requests
|
||||
|
||||
r = requests.get("http://api.xively.com/")
|
||||
print(r)
|
||||
print(r.content)
|
||||
print(r.text)
|
||||
print(r.content)
|
||||
print(r.json())
|
||||
|
||||
# It's mandatory to close response objects as soon as you finished
|
||||
# working with them. On MicroPython platforms without full-fledged
|
||||
# OS, not doing so may lead to resource leaks and malfunction.
|
||||
r.close()
|
Ładowanie…
Reference in New Issue