This should mirror the design on the ESP32 API for HTTP(S), and be implemented on rpi as a wrapper for libcurl.