Created
December 18, 2014 14:51
-
-
Save dhbradshaw/791d63545df3c605c872 to your computer and use it in GitHub Desktop.
Posting from an Arduino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//From http://stackoverflow.com/questions/3677400/making-a-http-post-request-using-arduino | |
IPAddress server(10,0,0,138); | |
String PostData = "someDataToPost"; | |
if (client.connect(server, 80)) { | |
client.println("POST /Api/AddParking/3 HTTP/1.1"); | |
client.println("Host: 10.0.0.138"); | |
client.println("User-Agent: Arduino/1.0"); | |
client.println("Connection: close"); | |
client.print("Content-Length: "); | |
client.println(PostData.length()); | |
client.println(); | |
client.println(PostData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment