A simple HTTP requester that can handle both HTTP and HTTPS requests is included as the HTTPClient
library.
Check the examples for use under HTTP and HTTPS configurations. In general, for HTTP connections (unsecured and very uncommon on the internet today) simply passing in a URL and performiung a GET is sufficient to transfer data.
// Error checking is left as an exercise for the reader... HTTPClient http; if (http.begin("http://my.server/url")) { if (http.GET() > 0) { String data = http.getString(); } http.end(); }
For HTTPS connections, simply add the appropriate WiFiClientSecure calls as needed (i.e. setInsecure()
, setTrustAnchor
, etc.). See the WiFiClientSecure documentation for more details.
// Error checking is left as an exercise for the reader... HTTPClient https; https.setInsecure(); // Use certs, but do not check their authenticity if (https.begin("https://my.secure.server/url")) { if (https.GET() > 0) { String data = https.getString(); } https.end(); }
Unlike the ESP8266 and ESP32 HTTPClient
implementations it is not necessary to create a WiFiClient
or WiFiClientSecure
to pass in to the HTTPClient
object.
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