Skip to content

Added PATCH request to HTTPClient #2610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions libraries/HTTPClient/src/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,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 *
Expand Down
2 changes: 2 additions & 0 deletions libraries/HTTPClient/src/HTTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ class HTTPClient

/// 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);
Expand Down