From 92220b76430e567658e0bc80e7b1013e43681520 Mon Sep 17 00:00:00 2001 From: Matthias Budde Date: Tue, 9 Apr 2019 21:22:47 +0200 Subject: [PATCH] Added PATCH request. (#2610) --- libraries/HTTPClient/src/HTTPClient.cpp | 16 ++++++++++++++++ libraries/HTTPClient/src/HTTPClient.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp index fcddf9b1..8b832988 100644 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ b/libraries/HTTPClient/src/HTTPClient.cpp @@ -483,6 +483,22 @@ int HTTPClient::POST(String payload) return POST((uint8_t *) payload.c_str(), payload.length()); } +/** + * sends a patch request to the server + * @param payload uint8_t * + * @param size size_t + * @return http code + */ +int HTTPClient::PATCH(uint8_t * payload, size_t size) +{ + return sendRequest("PATCH", payload, size); +} + +int HTTPClient::PATCH(String payload) +{ + return PATCH((uint8_t *) payload.c_str(), payload.length()); +} + /** * sends a put request to the server * @param payload uint8_t * diff --git a/libraries/HTTPClient/src/HTTPClient.h b/libraries/HTTPClient/src/HTTPClient.h index 88d67a05..745f6e64 100644 --- a/libraries/HTTPClient/src/HTTPClient.h +++ b/libraries/HTTPClient/src/HTTPClient.h @@ -160,6 +160,8 @@ public: /// request handling int GET(); + int PATCH(uint8_t * payload, size_t size); + int PATCH(String payload); int POST(uint8_t * payload, size_t size); int POST(String payload); int PUT(uint8_t * payload, size_t size);