Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cHttpHeaderClient Class Reference

#include <cHttpHeader.h>

Inheritance diagram for GrayLib::cHttpHeaderClient:
GrayLib::cHttpHeader

Public Member Functions

 cHttpHeaderClient (HTTPVERB_TYPE eVerb=HTTPVERB_TRACE, cStringA sUrlObject="") noexcept
 
void SetGETDefaults ()
 
void SetPOSTDefaults ()
 
HRESULT SetClientVerb (const char *pszPrefixData, StrLen_t iPrefixLen, bool bReadURL=true)
 
HRESULT WriteHeadClient (cStreamOutput *pClient) const
 
- Public Member Functions inherited from GrayLib::cHttpHeader
ITERATE_t get_HeadTagQty () const
 
bool HasHeadTag (HTTP_TAG_TYPE eTag) const
 
cStringA FindHeadTag (HTTP_TAG_TYPE eTag) const
 
cTimeInt FindHeadTagTime (HTTP_TAG_TYPE eTag) const
 
int FindHeadTagInt (HTTP_TAG_TYPE eTag) const
 
ITERATE_t AddHeadTag (HTTP_TAG_TYPE eTag, cStringA sVal)
 
ITERATE_t AddHeadTagTime (HTTP_TAG_TYPE eTag, cTimeInt tTime)
 
ITERATE_t AddHeadTagInt (HTTP_TAG_TYPE eTag, int iVal)
 
HRESULT ReadHeader (cStreamInput *pInp, OUT cStringA &sHeadVerb)
 
 UNITTEST_FRIEND (cHttpHeader)
 

Public Attributes

HTTPVERB_TYPE m_eVerb
 What does the client want ? More...
 
cStringA m_sURLObject
 the requested URL object. cNetURL::DeCode already called. More...
 

Additional Inherited Members

- Static Public Attributes inherited from GrayLib::cHttpHeader
static const int k_MaxTags = 256
 Arbitrary max number of tags for a single request/response page. More...
 
- Protected Member Functions inherited from GrayLib::cHttpHeader
HRESULT ReadHeadLine (const char *pData, StrLen_t iLen)
 
HRESULT WriteHeadTags (cStreamOutput *pClient) const
 
 cHttpHeader () noexcept
 
 ~cHttpHeader ()
 
- Protected Attributes inherited from GrayLib::cHttpHeader
cArraySortStructHash< cHttpHeadTagm_aTags
 Tags in the HTTP header. More...
 

Detailed Description

HTTP request header sent from client to server.

Constructor & Destructor Documentation

◆ cHttpHeaderClient()

GrayLib::cHttpHeaderClient::cHttpHeaderClient ( HTTPVERB_TYPE  eVerb = HTTPVERB_TRACE,
cStringA  sUrlObject = "" 
)
inlinenoexcept

Member Function Documentation

◆ SetClientVerb()

HRESULT GrayLib::cHttpHeaderClient::SetClientVerb ( const char *  pszPrefixData,
StrLen_t  iPrefixLen,
bool  bReadURL = true 
)

Read/Parse incoming HTTP client request line (First line) for a server. Like cHttpHeader::WriteHeadClient format "%s /%s " HTTP_VER_11 HTTP_CR

Returns
Number of bytes consumed = good client packet, HRESULT_WIN32_C(ERROR_IO_INCOMPLETE) = not enough data for a complete header. <0 = error fail this. psURL = the encoded URL requested.
Note
beware of buffer overrun attacks on this code.

◆ SetGETDefaults()

void GrayLib::cHttpHeaderClient::SetGETDefaults ( )

◆ SetPOSTDefaults()

void GrayLib::cHttpHeaderClient::SetPOSTDefaults ( )

◆ WriteHeadClient()

HRESULT GrayLib::cHttpHeaderClient::WriteHeadClient ( cStreamOutput pClient) const

Send client request to server. m_eVerb = HTTPVERB_GET, 'POST' or 'GET' e.g. "GET /stuff HTTP/1.1"

Returns
Length sent.

Member Data Documentation

◆ m_eVerb

HTTPVERB_TYPE GrayLib::cHttpHeaderClient::m_eVerb

What does the client want ?

◆ m_sURLObject

cStringA GrayLib::cHttpHeaderClient::m_sURLObject

the requested URL object. cNetURL::DeCode already called.


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