Guest User

Untitled

a guest
May 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /* Doing all these steps to make the request
  2. AT+RST
  3. AT+CWMODE=1
  4. AT+CWJAP="MyNetwork","MyPassword"
  5. AT+CIPMUX=1
  6. AT+CIPSTART=0,"TCP","myserver.com.br",80
  7. AT+CIPSEND=0,270
  8. */
  9.  
  10. String command = "POST /webservice/v1/dispositivo/atualizar_data_requisicao HTTP/1.1rn";
  11. comando += "Host: " + SERVER + "rn";
  12. comando += "User-Agent: Arduino/1.0rn";
  13. comando += "Connection: Closern";
  14. comando += "Content-Type: application/x-www-form-urlencoded;rn";
  15. comando += "Content-Length: " + String(data.length()) + "rnrn";
  16. comando += data;
  17.  
  18. esp8266.println(command);
  19.  
  20. delay(2000);
  21.  
  22. String response;
  23.  
  24. while(esp8266.available()) {
  25. response += esp8266.readStringUntil('r');
  26. }
  27.  
  28. Serial.print("Request response: ");
  29. Serial.println(response);
  30.  
  31. Recv 270 bxt⸮⸮C⸮
  32. SEND OK
  33.  
  34. +IPD,0.569:HTTP/1.0 200 OK
Add Comment
Please, Sign In to add comment