Guest User

Untitled

a guest
Sep 4th, 2017
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IPAddress server(192,168,1,120); // server IP address
  2. char PostData[] = "{\"name\": \"Fred\", \"age\": 31}"; // your JSON payload
  3.  
  4. .....
  5.  
  6. if (client.connect(server, 80)) {
  7. client.println("POST /doit HTTP/1.1");
  8. client.println("Host: 192.168.1.120"); // or generate from your server variable to not hardwire
  9. client.println("User-Agent: Arduino/unowifi");
  10. client.println("Connection: close");
  11. client.print("Content-Length: ");
  12. client.println(strlen(PostData));// number of bytes in the payload
  13. client.println();// important need an empty line here
  14. client.println(PostData);// the payload
  15. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×