Skip to content

Commit

Permalink
Added PATCH request. (#2610)
Browse files Browse the repository at this point in the history
  • Loading branch information
buddemat authored and me-no-dev committed Apr 9, 2019
1 parent dd64980 commit 92220b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions libraries/HTTPClient/src/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
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 @@ -160,6 +160,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

0 comments on commit 92220b7

Please sign in to comment.