Advertisement
Voha888

Untitled

Dec 2nd, 2019
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. //Файл ethernet
  2. #include <ETH.h>
  3. #include "ClientSecure.h"
  4.  
  5. void testClient() {
  6.   ClientSecure client;
  7.   if (!client.connect(host, port)) {
  8.     Serial.println("connection failed");
  9.     return;
  10.   }
  11.  
  12. ____________________________________________________________________________________________
  13.  
  14.  
  15. //Файл wifi
  16. #include <WiFi.h>
  17. #include "ClientSecure.h"
  18.  
  19. void testClient() {
  20.   ClientSecure client;
  21.   if (!client.connect(host, port)) {
  22.     Serial.println("connection failed");
  23.     return;
  24.   }
  25.  
  26. ________________________________________________________________________________________________
  27.  
  28.  
  29. //Файл с функциями
  30. String gst(String sheet_id, String sending_line)
  31. {
  32.   if (!client.connect(host, httpsPort))
  33.   {
  34.     Serial.println("connection failed");
  35.     client.stop();
  36.     return "0_connection_failed";
  37.   }
  38.  
  39.   client.print(String("GET ") + "/macros/s/" + sheet_id + "/exec?" + sending_line + " HTTP/1.1\r\n" +
  40.                "Host: " + host + "\r\n" +
  41.                "User-Agent: test\r\n" +
  42.                "Connection: keep-alive\r\n\r\n");
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement