Closed brentru closed 3 years ago
issue is in call of set_socket within the example. Lacks the required iface paramter:
requests.set_socket(socket)
to
requests.set_socket(socket, esp)
After modification, both HTTP and HTTPs domains work as expected:
----------------------------------------
JSON Response: {'url': 'https://httpbin.org/get', 'headers': {'User-Agent': 'Adafruit CircuitPython', 'Host': 'httpbin.org', 'X-Amzn-Trace-Id': 'Root=1-5feccee8-277a07403d46f4c14686b262'}, 'args': {}, 'origin': '108.12.192.159'}
----------------------------------------
POSTing data to https://httpbin.org/post: 31F
----------------------------------------
Data received from server: 31F
----------------------------------------
POSTing data to https://httpbin.org/post: {'Date': 'July 25, 2019'}
----------------------------------------
JSON Data received from server: {'Date': 'July 25, 2019'}
----------------------------------------
I'll put in a PR
Fixed by #58, merged and released.
Changing the GET_URL from
JSON_GET_URL = "http://httpbin.org/get" to
JSON_GET_URL = "https://httpbin.org/get"` raises error:Request and ESP32SPI are on the latest versions
Adafruit CircuitPython 6.1.0-beta.2 on 2020-12-03; Adafruit PyPortal with samd51j20