HTTPClient fork Support for Plantus Headers authentification
Fork of HTTPClient by
Diff: HTTPClient.h
- Revision:
- 16:1f743885e7de
- Parent:
- 12:89d09a6db00a
- Child:
- 19:9954a6e0ef05
--- a/HTTPClient.h Wed Aug 29 11:16:48 2012 +0000 +++ b/HTTPClient.h Thu Aug 30 15:38:57 2012 +0000 @@ -72,7 +72,7 @@ #endif //High Level setup functions - /** Execute a GET request on the url + /** Execute a GET request on the URL Blocks until completion @param url : url on which to execute the request @param pDataIn : pointer to an IHTTPDataIn instance that will collect the data returned by the request, can be NULL @@ -81,7 +81,7 @@ */ HTTPResult get(const char* url, IHTTPDataIn* pDataIn, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT); //Blocking - /** Execute a GET request on the url + /** Execute a GET request on the URL Blocks until completion This is a helper to directly get a piece of text from a HTTP result @param url : url on which to execute the request @@ -92,7 +92,7 @@ */ HTTPResult get(const char* url, char* result, size_t maxResultLen, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT); //Blocking - /** Execute a POST request on the url + /** Execute a POST request on the URL Blocks until completion @param url : url on which to execute the request @param dataOut : a IHTTPDataOut instance that contains the data that will be posted @@ -102,6 +102,25 @@ */ HTTPResult post(const char* url, const IHTTPDataOut& dataOut, IHTTPDataIn* pDataIn, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT); //Blocking + /** Execute a PUT request on the URL + Blocks until completion + @param url : url on which to execute the request + @param dataOut : a IHTTPDataOut instance that contains the data that will be put + @param pDataIn : pointer to an IHTTPDataIn instance that will collect the data returned by the request, can be NULL + @param timeout waiting timeout in ms (osWaitForever for blocking function, not recommended) + @return 0 on success, HTTP error (<0) on failure + */ + HTTPResult put(const char* url, const IHTTPDataOut& dataOut, IHTTPDataIn* pDataIn, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT); //Blocking + + /** Execute a DELETE request on the URL + Blocks until completion + @param url : url on which to execute the request + @param pDataIn : pointer to an IHTTPDataIn instance that will collect the data returned by the request, can be NULL + @param timeout waiting timeout in ms (osWaitForever for blocking function, not recommended) + @return 0 on success, HTTP error (<0) on failure + */ + HTTPResult del(const char* url, IHTTPDataIn* pDataIn, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT); //Blocking + /** Get last request's HTTP response code @return The HTTP response code of the last request */ @@ -112,6 +131,8 @@ { HTTP_GET, HTTP_POST, + HTTP_PUT, + HTTP_DELETE, HTTP_HEAD };