NetBurner 3.5.0
PDF Version
 
ParsedURI Class Reference

Parsed Uniform Resource Identifier Class (URI) More...

#include <http_funcs.h>

Public Member Functions

void NewUri (const char *uri, uint16_t timeout=20 *TICKS_PER_SECOND, bool skipLookup=false)
 Replace the existing (URI) object with new information.
 
 ParsedURI ()
 Constructor to create a new blank URI object. For rare cases.
 
 ParsedURI (const char *uri, uint16_t timeout=20 *TICKS_PER_SECOND, bool skipLookup=false)
 Constructor to create a new URI object.
 
bool valid () const
 Check to see if URI is valid.
 
const char * GetPath ()
 Get the cached URI path.
 
const char * GetHost ()
 Get the cached URI Host name.
 
IPADDR GetAddr ()
 Get the resolved host Address.
 
uint16_t GetPort ()
 Get the cached URI network port number.
 
bool IsSecure ()
 Check the security state of the cached URI object. Requires WEB_CLIENT_SSL_SUPPORT be defined in predef.h.
 
void Invalidate ()
 Set the state of the cached URI object to invalid.
 

Detailed Description

Parsed Uniform Resource Identifier Class (URI)

Web Client HTTP functions can pass a URL, which has to be parsed and use DNS to resolve if necessary. This class provides an object with the parsed and DNS results that can be used for future transactions. The intent of using this class is to cache the parsed results and dns lookup for communication to the same resource.

Enabling WEB_CLIENT_SSL_SUPPORT in predef.h adds TLS support.

The maximum size of the cached URI, path and hose are 256 bytes each.

Constructor & Destructor Documentation

◆ ParsedURI()

ParsedURI::ParsedURI ( const char * uri,
uint16_t timeout = 20 * TICKS_PER_SECOND,
bool skipLookup = false )
inline

Constructor to create a new URI object.

Parameters
uriPointer to a URI.
timeoutNumber of sysem time tick to wait.
skipLookupSkip URI lookup. Default is false.

Member Function Documentation

◆ GetAddr()

IPADDR ParsedURI::GetAddr ( )
inline

Get the resolved host Address.

Returns
The resolved host address.

◆ GetHost()

const char * ParsedURI::GetHost ( )
inline

Get the cached URI Host name.

Returns
Pointer to the cached host name if the cached URI is valid, otherwise NULL.

◆ GetPath()

const char * ParsedURI::GetPath ( )
inline

Get the cached URI path.

Returns
Pointer to the cached path string if the cached URI is valid, otherwise NULL.

◆ GetPort()

uint16_t ParsedURI::GetPort ( )
inline

Get the cached URI network port number.

Returns
The cached URI port number if the cached URI is valid, otherwise 0.

◆ IsSecure()

bool ParsedURI::IsSecure ( )
inline

Check the security state of the cached URI object. Requires WEB_CLIENT_SSL_SUPPORT be defined in predef.h.

Return values
trueSecure.
falseURI object is invalid.

◆ NewUri()

void ParsedURI::NewUri ( const char * uri,
uint16_t timeout = 20 *TICKS_PER_SECOND,
bool skipLookup = false )

Replace the existing (URI) object with new information.

Update the existing URI with a new value.

Parameters
uriPointer to a URI string.
timeoutNumber of sysem time ticks to wait.
skipLookupSkip URI lookup. Default is false.

◆ valid()

bool ParsedURI::valid ( ) const
inline

Check to see if URI is valid.

Return values
trueif valid
falseif not valid

The documentation for this class was generated from the following file: