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

Add support for PATCH operations

This commit is contained in:
Sandeep Mistry
2017-01-03 16:20:03 -05:00
parent 68aebb113a
commit d261fa35f5
3 changed files with 45 additions and 0 deletions

View File

@ -332,6 +332,31 @@ int HttpClient::put(const char* aURLPath, const char* aContentType, int aContent
return startRequest(aURLPath, HTTP_METHOD_PUT, aContentType, aContentLength, aBody);
}
int HttpClient::patch(const char* aURLPath)
{
return startRequest(aURLPath, HTTP_METHOD_PATCH);
}
int HttpClient::patch(const String& aURLPath)
{
return patch(aURLPath.c_str());
}
int HttpClient::patch(const char* aURLPath, const char* aContentType, const char* aBody)
{
return patch(aURLPath, aContentType, strlen(aBody), (const byte*)aBody);
}
int HttpClient::patch(const String& aURLPath, const String& aContentType, const String& aBody)
{
return patch(aURLPath.c_str(), aContentType.c_str(), aBody.length(), (const byte*)aBody.c_str());
}
int HttpClient::patch(const char* aURLPath, const char* aContentType, int aContentLength, const byte aBody[])
{
return startRequest(aURLPath, HTTP_METHOD_PATCH, aContentType, aContentLength, aBody);
}
int HttpClient::del(const char* aURLPath)
{
return startRequest(aURLPath, HTTP_METHOD_DELETE);