Notifications
Clear all

How to make a POST call over HTTPS

2 Posts
2 Users
0 Likes
2,429 Views
(@garnold)
Member
Joined: 5 years ago
Posts: 81
Topic starter  

Hello everyone! I'm in search for some help for my sketch. I'm posting this in the Arduino section because I could use a mkr1010 in this project, but I could just as easily pull a ESP8266 based board into the mix if it is easier.

I'm not trying to do anything all the crazy, but hitting walls on this project.

I have an HTTPS location that excepts some simple JSON in the body. 

This would sound easy but NOPE! I can't seem to find an example of how to send JSON over HTTPS.

Either I'm reading that the 8266 boards do not send over HTTPS or just not getting an example for POST.

Can anyone here help me please?

Thank you very much!


   
Quote
triform
(@triform)
Member
Joined: 5 years ago
Posts: 324
 

@garnold

I have not done any ESP based https, and not sure how or will it do certs etc... But would assume just like normal http, just with a tls based connection. 

This is ESP speak here:

Are you using the HTTPClient class?

I do send json back in an httpio lib I did a while back ( https://github.com/jscottb/ESP8266_http_io )  I just format the json in sprintf's and return in the body of the return post to the client.

I would think you should be able to do an HTTPClient.Post with the json as the parm. 

Hope this helps some.

Scott


   
ReplyQuote