esp8266 http/https request lib for micropython
import request
str, HTTP method: 'GET', 'POST'...
dict, Request headers
data, HTTP data, request() send data when data is not b''
, even if http method is GET
str, protocol, suffix:
shoould be added, e.g., http:
str, host
str, path
int, port
bool, decide whether to use SSL
def __init__(
self,
method: str = 'GET', # HTTP Mothod: GET, POST...
url: str = '', # URL, e.g., https://github.com
params: dict = None, # a dict of params
headers: dict = None, # a dict of http request headers
data: bytes = None # data
)
header: Host
, Content-Length
will be automaticly calculated
Do request and return response
- v0.1.1
basic http/https message sending and receiving completed