adafruit_requests
A requests-like library for web interfacing
Author(s): ladyada, Paul Sokolovsky, Scott Shawcroft
Adapted from https://github.com/micropython/micropython-lib/tree/master/urequests
micropython-lib consists of multiple modules from different sources and authors. Each module comes under its own licensing terms. Short name of a license can be found in a file within a module directory (usually metadata.txt or setup.py). Complete text of each license used is provided at https://github.com/micropython/micropython-lib/blob/master/LICENSE
author=’Paul Sokolovsky’ license=’MIT’
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Connection Manager library: https://github.com/adafruit/Adafruit_CircuitPython_ConnectionManager
Raised when requests has retried to make a request unsuccessfully.
The response from a request, contains all the headers/content
Close out the socket. If we have a session free it instead.
The HTTP content direct from the socket, as bytes
The response headers. Does not include headers from the trailer until the content has been read.
An iterator that will stream data by only reading ‘chunk_size’ bytes and yielding them, when we can’t buffer the whole datastream
The HTTP content, parsed into a json dictionary
The status reason returned by the server
The underlying socket object (CircuitPython extension, not in standard requests)
Under the following circumstances, calling code may directly access the underlying socket object:
The request was made with
stream=True
The request headers included
{'connection': 'close'}
No methods or properties on the Response object that access the response content may be used
Methods and properties that access response headers may be accessed.
It is still necessary to close
the response object for correct management of sockets, including doing so implicitly via with requests.get(...) as response
.
The status code returned by the server
The HTTP content, encoded into a string according to the HTTP header encoding
HTTP session that shares sockets and ssl context.
Send HTTP DELETE request
Send HTTP GET request
Send HTTP HEAD request
Send HTTP OPTIONS request
Send HTTP PATCH request
Send HTTP POST request
Send HTTP PUT request
Perform an HTTP request to the given url which we will parse to determine whether to use SSL (’https://’) or not. We can also send some provided ‘data’ or a json dictionary which we will stringify. ‘headers’ is optional HTTP headers sent along. ‘stream’ will determine if we buffer everything, or whether to only read only when requested
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4