1
0
mirror of https://github.com/arduino-libraries/ArduinoHttpClient.git synced 2025-06-11 17:08:08 +03:00

Add new del API for HTTP DELETE method

This commit is contained in:
Sandeep Mistry
2016-06-22 12:16:12 -04:00
parent c3023b25ee
commit bdc5281733
3 changed files with 45 additions and 6 deletions

View File

@ -50,14 +50,10 @@ void setup() {
void loop() {
Serial.println("making DELETE request");
String contentType = "application/x-www-form-urlencoded";
String delData = "name=light&age=46";
client.beginRequest();
client.startRequest("/", HTTP_METHOD_DELETE);
client.sendHeader("Content-Type", "application/x-www-form-urlencoded");
client.sendHeader("Content-Length", delData.length());
client.endRequest();
client.write((const byte*)delData.c_str(), delData.length());
client.del("/", contentType, delData);
// read the status code and content length of the response
statusCode = client.responseStatusCode();