| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 68aebb1 commit d261fa3
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,7 @@ WebSocketClient KEYWORD1 | |||
| 17 | 17 | get KEYWORD2 | |
| 18 | 18 | post KEYWORD2 | |
| 19 | 19 | put KEYWORD2 | |
| 20 | + patch KEYWORD2 | ||
| 20 | 21 | startRequest KEYWORD2 | |
| 21 | 22 | beginRequest KEYWORD2 | |
| 22 | 23 | sendHeader KEYWORD2 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -332,6 +332,31 @@ int HttpClient::put(const char* aURLPath, const char* aContentType, int aContent | |||
| 332 | 332 | return startRequest(aURLPath, HTTP_METHOD_PUT, aContentType, aContentLength, aBody); | |
| 333 | 333 | } | |
| 334 | 334 | ||
| 335 | + int HttpClient::patch(const char* aURLPath) | ||
| 336 | + { | ||
| 337 | + return startRequest(aURLPath, HTTP_METHOD_PATCH); | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + int HttpClient::patch(const String& aURLPath) | ||
| 341 | + { | ||
| 342 | + return patch(aURLPath.c_str()); | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + int HttpClient::patch(const char* aURLPath, const char* aContentType, const char* aBody) | ||
| 346 | + { | ||
| 347 | + return patch(aURLPath, aContentType, strlen(aBody), (const byte*)aBody); | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + int HttpClient::patch(const String& aURLPath, const String& aContentType, const String& aBody) | ||
| 351 | + { | ||
| 352 | + return patch(aURLPath.c_str(), aContentType.c_str(), aBody.length(), (const byte*)aBody.c_str()); | ||
| 353 | + } | ||
| 354 | + | ||
| 355 | + int HttpClient::patch(const char* aURLPath, const char* aContentType, int aContentLength, const byte aBody[]) | ||
| 356 | + { | ||
| 357 | + return startRequest(aURLPath, HTTP_METHOD_PATCH, aContentType, aContentLength, aBody); | ||
| 358 | + } | ||
| 359 | + | ||
| 335 | 360 | int HttpClient::del(const char* aURLPath) | |
| 336 | 361 | { | |
| 337 | 362 | return startRequest(aURLPath, HTTP_METHOD_DELETE); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,7 @@ static const int HTTP_ERROR_INVALID_RESPONSE =-4; | |||
| 29 | 29 | #define HTTP_METHOD_GET "GET" | |
| 30 | 30 | #define HTTP_METHOD_POST "POST" | |
| 31 | 31 | #define HTTP_METHOD_PUT "PUT" | |
| 32 | + #define HTTP_METHOD_PATCH "PATCH" | ||
| 32 | 33 | #define HTTP_METHOD_DELETE "DELETE" | |
| 33 | 34 | #define HTTP_HEADER_CONTENT_LENGTH "Content-Length" | |
| 34 | 35 | #define HTTP_HEADER_CONTENT_TYPE "Content-Type" | |
@@ -104,6 +105,24 @@ class HttpClient : public Client | |||
| 104 | 105 | int put(const String& aURLPath, const String& aContentType, const String& aBody); | |
| 105 | 106 | int put(const char* aURLPath, const char* aContentType, int aContentLength, const byte aBody[]); | |
| 106 | 107 | ||
| 108 | + /** Connect to the server and start to send a PATCH request. | ||
| 109 | + @param aURLPath Url to request | ||
| 110 | + @return 0 if successful, else error | ||
| 111 | + */ | ||
| 112 | + int patch(const char* aURLPath); | ||
| 113 | + int patch(const String& aURLPath); | ||
| 114 | + | ||
| 115 | + /** Connect to the server and send a PATCH request | ||
| 116 | + with body and content type | ||
| 117 | + @param aURLPath Url to request | ||
| 118 | + @param aContentType Content type of request body | ||
| 119 | + @param aBody Body of the request | ||
| 120 | + @return 0 if successful, else error | ||
| 121 | + */ | ||
| 122 | + int patch(const char* aURLPath, const char* aContentType, const char* aBody); | ||
| 123 | + int patch(const String& aURLPath, const String& aContentType, const String& aBody); | ||
| 124 | + int patch(const char* aURLPath, const char* aContentType, int aContentLength, const byte aBody[]); | ||
| 125 | + | ||
| 107 | 126 | /** Connect to the server and start to send a DELETE request. | |
| 108 | 127 | @param aURLPath Url to request | |
| 109 | 128 | @return 0 if successful, else error | |
| Back | FazBrowse Home | New Git URL |
0 commit comments