OpenZWave Library: Basic HTTP(s) Client

| OpenZWave Library 1.6.0

Classes | Enumerations | Functions
Basic HTTP(s) Client

## Classes
class | OpenZWave::SimpleHTTPClient::TcpSocket
| a TCP Socket that can optionally be protected via SSL More...
class | OpenZWave::SimpleHTTPClient::POST
| This class is used for Posting data to a HTTP(s) server. More...
struct | OpenZWave::SimpleHTTPClient::Request
| Main class for making a HTTP request to a HTTP(s) server. More...
class | OpenZWave::SimpleHTTPClient::HttpSocket
| a Socket that speaks HTTP protocol. More...
class | OpenZWave::SimpleHTTPClient::SocketSet
| Support Multiple TCP Socket connections. More...

## Enumerations
enum | OpenZWave::SimpleHTTPClient::SSLResult { OpenZWave::SimpleHTTPClient::SSLR_OK = 0x0 , OpenZWave::SimpleHTTPClient::SSLR_NO_SSL = 0x1 , OpenZWave::SimpleHTTPClient::SSLR_FAIL = 0x2 , OpenZWave::SimpleHTTPClient::SSLR_CERT_EXPIRED = 0x4 , OpenZWave::SimpleHTTPClient::SSLR_CERT_REVOKED = 0x8 , OpenZWave::SimpleHTTPClient::SSLR_CERT_CN_MISMATCH = 0x10 , OpenZWave::SimpleHTTPClient::SSLR_CERT_NOT_TRUSTED = 0x20 , OpenZWave::SimpleHTTPClient::SSLR_CERT_MISSING = 0x40 , OpenZWave::SimpleHTTPClient::SSLR_CERT_SKIP_VERIFY = 0x80 , OpenZWave::SimpleHTTPClient::SSLR_CERT_FUTURE = 0x100 , OpenZWave::SimpleHTTPClient::_SSLR_FORCE32BIT = 0x7fffffff }
| Result Codes for SSL operations. More...

## Functions
bool | OpenZWave::SimpleHTTPClient::InitNetwork ()
| Initialize the Network for HTTP requests. More...
void | OpenZWave::SimpleHTTPClient::StopNetwork ()
| Stop the Network for HTTP requests. More...
bool | OpenZWave::SimpleHTTPClient::HasSSL ()
| Indicates if we support HTTPS requests. More...
bool | OpenZWave::SimpleHTTPClient::SplitURI (const std::string &uri, std::string &host, std::string &file, int &port)
| Split a URL into its different parts/ports etc. More...
void | OpenZWave::SimpleHTTPClient::URLEncode (const std::string &s, std::string &enc)
| Encode a String suitable for sending as a URL request (eg Get) More...

## Detailed Description

a Basic HTTP Client for talking to webservers

## Enumeration Type Documentation

## ◆ SSLResult

enum OpenZWave::SimpleHTTPClient::SSLResult

Result Codes for SSL operations.

Enumerator
SSLR_OK | No Error
SSLR_NO_SSL | SSL Is not required
SSLR_FAIL | Internal SSL Engine Failure
SSLR_CERT_EXPIRED | SSL Certificate has expired
SSLR_CERT_REVOKED | SSL Certificate is revoked
SSLR_CERT_CN_MISMATCH | SSL CN Name does not match Hostname
SSLR_CERT_NOT_TRUSTED | SSL Certificate is not trusted
SSLR_CERT_MISSING | SSL Certificate is missing
SSLR_CERT_SKIP_VERIFY | SSL Certificate Verification is disabled
SSLR_CERT_FUTURE | SSL Certificate is valid in the future
_SSLR_FORCE32BIT |

## Function Documentation

## ◆ HasSSL()

bool OpenZWave::SimpleHTTPClient::HasSSL | ( |  | ) |

Indicates if we support HTTPS requests.

Indicates if we support HTTPS requests

Returns
  success/failure

Todo:
  SSL is not actually implemented yet.

## ◆ InitNetwork()

bool OpenZWave::SimpleHTTPClient::InitNetwork | ( |  | ) |

Initialize the Network for HTTP requests.

Initializes the Network for HTTP requests

Returns
  success/failure

## ◆ SplitURI()

bool OpenZWave::SimpleHTTPClient::SplitURI | ( | const std::string & | uri,
|  | std::string & | host,
|  | std::string & | file,
|  | int & | port
| ) |  |

Split a URL into its different parts/ports etc.

Split a URL Into the different parts/ports

Parameters

  uri | the URL to parse
  host | the Hostname of the URL
  file | the directory/file name of the URL
  port | the port number of the URL, or 80 if not specified

Returns
  success/failure

## ◆ StopNetwork()

void OpenZWave::SimpleHTTPClient::StopNetwork | ( |  | ) |

Stop the Network for HTTP requests.

Stops the Network for HTTP requests and releases resources associated with it

## ◆ URLEncode()

void OpenZWave::SimpleHTTPClient::URLEncode | ( | const std::string & | s,
|  | std::string & | enc
| ) |  |

Encode a String suitable for sending as a URL request (eg Get)

Encode a String so it can be sent as part of a URL request

Parameters

  s | the string to encode
  enc | the encoded version of the string that is returned