1
0
mirror of https://github.com/arduino-libraries/ArduinoHttpClient.git synced 2025-08-16 21:41:56 +03:00

Updated to new API as discussed on the Arduino Developers mailing list. Part of the process of moving the library to live as one of the core Arduino libraries.

The get/put/post calls have been streamlined to require fewer parameters in the basic case - i.e. you can just call http.get("www.mysite.com", "/somepath") to make a simple request.

The accept header has been removed from the list of possible parameters to get/put/post - if you need to use it then send it manually with sendHeader(...) instead.

You don't need to call finishRequest() after the initial call to get/put/post if you aren't going to send any headers.  However, if you /do/ want to send extra headers then you need to call beginRequest() before the get/put/post and endRequest() at the end of all the sent data (so after the data as well as the headers).  E.g.

	http.beginRequest();
	http.post("www.somesite.com", "/somepath");
	http.sendHeader("Content-Length", strlen(postdata));
	http.print(postdata);
	http.endRequest();
This commit is contained in:
amcewen
2012-03-30 15:11:13 +01:00
parent 222f718705
commit 44d790b8a6
7 changed files with 323 additions and 144 deletions

1
README
View File

@@ -2,7 +2,6 @@ HttpClient is a library to make it easier to interact with web servers from Ardu
Dependencies:
- Requires the new Ethernet library API (with DHCP and DNS) which is in Arduino 1.0.
- Requires the b64 base64 encoding library, available from https://github.com/amcewen/b64
In normal usage, handles the outgoing request and Host header. The returned status code is
parsed for you, as is the Content-Length header (if present).