PaperdInk-Library icon indicating copy to clipboard operation
PaperdInk-Library copied to clipboard

HTTPClient tutorial needed

Open jukkaaahola opened this issue 2 years ago • 1 comments

Could you include a tutorial on how to call custom REST/JSON API calls hosted on any HTTP(S) address. The quote example is the closest, but I struggle with making the connection as my connections always fail. I have tried to import the SSL certificate into the code by exporting them from Chrome browser. Even if my cert is actually based on the same Let's Encrypt root CA, the connection fails with my URL but not with the quote URL. Then I hosted the service on HTTP instead of HTTPS with no certificate, and still fails. Some instructions how to make the HTTPS connection work with any valid certificate would be nice. I think it is a cert issue but I don't know why.

WiFiClientSecure *client = new WiFiClientSecure;
client->setCACert(cert);

{
    HTTPClient https;
    https.begin(*client, url);

jukkaaahola avatar Jan 25 '23 22:01 jukkaaahola