Renesas / SecureDweet
Embed: (wiki syntax)

« Back to documentation index

SecureHttpClient Class Reference

SecureHttpClient Class Reference

HTTPS Client based on mbed and wolfSSL HTTP Client. More...

#include <SecureHttpClient.h>

Public Member Functions

HttpResult basicAuth (const char *user, const char *password)
 Provides a basic authentification feature (Base64 encoded username and password) Pass two NULL pointers to switch back to no authentication.
HttpResult get (const char *url, IHttpDataIn *pDataIn, int timeout=HTTP_CLIENT_DEFAULT_TIMEOUT)
 Execute a GET request on the URL Blocks until completion.
HttpResult post (const char *url, const IHttpDataOut &dataOut, IHttpDataIn *pDataIn, int timeout=HTTP_CLIENT_DEFAULT_TIMEOUT)
 Execute a POST request on the URL Blocks until completion.
HttpResult put (const char *url, const IHttpDataOut &dataOut, IHttpDataIn *pDataIn, int timeout=HTTP_CLIENT_DEFAULT_TIMEOUT)
 Execute a PUT request on the URL Blocks until completion.
HttpResult del (const char *url, IHttpDataIn *pDataIn, int timeout=HTTP_CLIENT_DEFAULT_TIMEOUT)
 Execute a DELETE request on the URL Blocks until completion.
int getHTTPResponseCode ()
 Get last request's HTTP response code.

Detailed Description

HTTPS Client based on mbed and wolfSSL HTTP Client.

Definition at line 60 of file SecureHttpClient.h.


Member Function Documentation

HttpResult basicAuth ( const char *  user,
const char *  password 
)

Provides a basic authentification feature (Base64 encoded username and password) Pass two NULL pointers to switch back to no authentication.

Parameters:
userusername to use for authentication, must remain valid durlng the whole HTTP session
userpassword to use for authentication, must remain valid durlng the whole HTTP session

Definition at line 147 of file SecureHttpClient.cpp.

HttpResult del ( const char *  url,
IHttpDataIn pDataIn,
int  timeout = HTTP_CLIENT_DEFAULT_TIMEOUT 
)

Execute a DELETE request on the URL Blocks until completion.

Parameters:
url: url on which to execute the request
pDataIn: pointer to an IHttpDataIn instance that will collect the data returned by the request, can be NULL
timeoutwaiting timeout in ms (osWaitForever for blocking function, not recommended)
Returns:
0 on success, HTTP error (<0) on failure

Definition at line 176 of file SecureHttpClient.cpp.

HttpResult get ( const char *  url,
IHttpDataIn pDataIn,
int  timeout = HTTP_CLIENT_DEFAULT_TIMEOUT 
)

Execute a GET request on the URL Blocks until completion.

Parameters:
url: url on which to execute the request
pDataIn: pointer to an IHttpDataIn instance that will collect the data returned by the request, can be NULL
timeoutwaiting timeout in ms (osWaitForever for blocking function, not recommended)
Returns:
0 on success, HTTP error (<0) on failure

Definition at line 157 of file SecureHttpClient.cpp.

int getHTTPResponseCode (  )

Get last request's HTTP response code.

Returns:
The HTTP response code of the last request

Definition at line 181 of file SecureHttpClient.cpp.

HttpResult post ( const char *  url,
const IHttpDataOut dataOut,
IHttpDataIn pDataIn,
int  timeout = HTTP_CLIENT_DEFAULT_TIMEOUT 
)

Execute a POST request on the URL Blocks until completion.

Parameters:
url: url on which to execute the request
dataOut: a IHttpDataOut instance that contains the data that will be posted
pDataIn: pointer to an IHttpDataIn instance that will collect the data returned by the request, can be NULL
timeoutwaiting timeout in ms (osWaitForever for blocking function, not recommended)
Returns:
0 on success, HTTP error (<0) on failure

Definition at line 164 of file SecureHttpClient.cpp.

HttpResult put ( const char *  url,
const IHttpDataOut dataOut,
IHttpDataIn pDataIn,
int  timeout = HTTP_CLIENT_DEFAULT_TIMEOUT 
)

Execute a PUT request on the URL Blocks until completion.

Parameters:
url: url on which to execute the request
dataOut: a IHttpDataOut instance that contains the data that will be put
pDataIn: pointer to an IHttpDataIn instance that will collect the data returned by the request, can be NULL
timeoutwaiting timeout in ms (osWaitForever for blocking function, not recommended)
Returns:
0 on success, HTTP error (<0) on failure

Definition at line 170 of file SecureHttpClient.cpp.