Hello world example of a TLS client: fetch an HTTPS page. The canonical source for this example lives at https://github.com/ARMmbed/mbed-os-example-tls

Embed: (wiki syntax)

« Back to documentation index

HelloHttpsClient Class Reference

HelloHttpsClient Class Reference

This class implements the logic for fetching a file from a webserver using a TCP socket and parsing the result. More...

#include <HelloHttpsClient.h>

Public Member Functions

 HelloHttpsClient (const char *in_server_name, const char *in_server_addr, const uint16_t in_server_port)
 Construct an HelloHttpsClient instance.
 ~HelloHttpsClient ()
 Free any allocated resources.
int run ()
 Start the connection to the server and request to read the file at HTTP_REQUEST_FILE_PATH.

Detailed Description

This class implements the logic for fetching a file from a webserver using a TCP socket and parsing the result.

Definition at line 51 of file HelloHttpsClient.h.


Constructor & Destructor Documentation

HelloHttpsClient ( const char *  in_server_name,
const char *  in_server_addr,
const uint16_t  in_server_port 
)

Construct an HelloHttpsClient instance.

Parameters:
[in]in_server_nameThe server host name
[in]in_server_addrThe server domain/IP address
[in]in_server_portThe server port

Definition at line 71 of file HelloHttpsClient.cpp.

Free any allocated resources.

Definition at line 86 of file HelloHttpsClient.cpp.


Member Function Documentation

int run (  )

Start the connection to the server and request to read the file at HTTP_REQUEST_FILE_PATH.

Returns:
0 if successful

Definition at line 97 of file HelloHttpsClient.cpp.