Advertisement
ubidefeo

HTTP Client

Mar 21st, 2023 (edited)
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <ArduinoHttpClient.h>
  2.  
  3. WiFiClient wifi;
  4. HttpClient httpClient = HttpClient(wifi, "ubidefeo.com", 80);
  5.  
  6.  
  7. /*
  8. dovresti avere una callback di una Cloud Variable con `onChange`
  9. tipo se la tua variabile si chiama "bottoneURL"
  10. */
  11.  
  12.  
  13. void onBottoneURLChange(){
  14.     /* qui vai ad inserire la chiamata alla URL */
  15.     httpClient.beginRequest();
  16.     httpClient.get("/");
  17.     httpClient.endRequest();
  18.  
  19.      Serial.println(httpClient.responseStatusCode());
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement