class HCHttpRequest

HTTP Request/Response class

Public Methods

[more]const char* GetResponseMessage( int iCode )
This function make reponse message for response code
[more] HCHttpRequest()
Constructor - initialize internal variables
[more] ~HCHttpRequest()
Destructor
[more]void SetMethod( int iMethod )
set HTTP method
[more]int ParseRequest(char* pszRequest, int iRequestLen, int* piParseLen, int iFlags )
parse HTTP Request.
[more]char* MakeRequest( char* pszInput )
make HTTP Protocol to string
[more]int GetRequestSize()
calculate HTTP request's size
[more]const char* GetMethod()
return HTTP.
[more]int GetMethodInt()
return integer value for HTTP method.
[more]const char* GetUri()
return Uri string
[more]const char* GetHostName()
return attribute value of HOST.
[more]int GetResponseCode()
return response code
[more]char GetProtocol()
return code for HTTP protocol version
[more]const char* GetIp()
return domain address or IP address of HTTP server
[more]int GetPort()
return port number of HTTP server.
[more]AttrMap* GetAttrMap()
return pointer of Attribute Map
[more]int DeleteAllAttrMap()
delete all item of attribute map.
[more]const char* GetAttributeValue( const char* szKey )
return attribute value of attribute.
[more]int GetContentLength( )
return length of body.
[more]int IsChunk()
Is using chunk option?
[more]int IsConnectionClose()
close connection?
[more]int IsConnectionKeepAlive()
is continuing connection?
[more]void Clear( int fisDeleteAttribute )
Initialize internal variables.
[more]int ParseUri( const char* szUri, string & strHostName, int & iPort )
parse uri to host name and port
[more]void ArrangeAttribute()
Store cost to spend often to reduce attribute retrieval time in other internal variable or establish to flag
[more]void ProcessAttribute( string & strKey, string & strValue )
covert special attribute value to lower case string.
[more]int SetAttributeValue( const char* szKey, const char* szValue )
modify value of attribute in attribute map.
[more]int AddAttributeValue( const char* szKey, const char* szValue )
add attribute to attribute map.
[more]void SetContentLength( int iLength )
set length of body.


Documentation

HTTP Request/Response class

contain data of HTTP Request Header in internal variable and parse and make HTTP Request data

oconst char* GetResponseMessage( int iCode )
This function make reponse message for response code

Parameters:
iCode - response code
Returns:
returns pointer of reponse message string.

o HCHttpRequest()
Constructor - initialize internal variables

o ~HCHttpRequest()
Destructor

ovoid SetMethod( int iMethod )
set HTTP method

Parameters:
iMethod - HTTP method ( HC_HTTP_GET, HC_HTTP_POST )

oint ParseRequest(char* pszRequest, int iRequestLen, int* piParseLen, int iFlags )
parse HTTP Request.

Parameters:
pszRequest - HTTP request string
iRequestLen - pszRequest length
piParseLen - [out] Variable to store construed position
Returns:
if it success, it returns HC_OK. if there needs more Request data, it returns HC_MORE_REQUEST. if it failed, it returns HC_ERROR.

ochar* MakeRequest( char* pszInput )
make HTTP Protocol to string

[note] if you do not insert pszInput variable, you must delete pointer of this function's return.

Parameters:
pszInput - [out] buffer for http protocol request string
Returns:
if it is successes, it returns HTTP Protocol Request string. otherwise it returns NULL.

oint GetRequestSize()
calculate HTTP request's size

Returns:
if there is no error, it returns request header size. otherwise it returns HC_ERROR.

oconst char* GetMethod()
return HTTP.

Returns:
HTTP method string

oint GetMethodInt()
return integer value for HTTP method.

Returns:
integer value for HTTP method

oconst char* GetUri()
return Uri string

Returns:
uri string like "http://www.enpia.net/cgi-bin/test.cgi"

oconst char* GetHostName()
return attribute value of HOST.

Returns:
attribute value of HOST

oint GetResponseCode()
return response code

Returns:
response code

ochar GetProtocol()
return code for HTTP protocol version

Returns:
protocol verison ( HC_HTTP_VERSION_0_9, HC_HTTP_VERSION_1_0, HC_HTTP_VERSION_1_1 )

oconst char* GetIp()
return domain address or IP address of HTTP server

Returns:
domain address or IP address of HTTP server

oint GetPort()
return port number of HTTP server.

Returns:
port number of HTTP server

oAttrMap* GetAttrMap()
return pointer of Attribute Map

Returns:
attribute map's pointer

oint DeleteAllAttrMap()
delete all item of attribute map.

Returns:
HC_OK.

oconst char* GetAttributeValue( const char* szKey )
return attribute value of attribute.

Parameters:
szKey - attribute name
Returns:
attribute value

oint GetContentLength( )
return length of body.

Returns:
body length

oint IsChunk()
Is using chunk option?

Returns:
if use chunk option, return HC_OK. otherwise return HC_ERROR.

oint IsConnectionClose()
close connection?

Returns:
if close connection, return HC_OK. otherwise return HC_ERROR.

oint IsConnectionKeepAlive()
is continuing connection?

Returns:
if continue connection, return HC_OK. otherwise return HC_ERROR.

ovoid Clear( int fisDeleteAttribute )
Initialize internal variables.

Parameters:
fisDeleteAttribute - if set 1, delete attribute list.

oint ParseUri( const char* szUri, string & strHostName, int & iPort )
parse uri to host name and port

Parameters:
szUri - [in] Uri ex) http://www.enpia.net, www.enpia.net, http://www.enpia.net:8080/
strHostName - [out] Host Name
iPort - [out] port number
Returns:
if success, return HC_OK. otherwise return HC_ERROR.

ovoid ArrangeAttribute()
Store cost to spend often to reduce attribute retrieval time in other internal variable or establish to flag

ovoid ProcessAttribute( string & strKey, string & strValue )
covert special attribute value to lower case string.

Parameters:
strKey - attribute key string
strValue - attribute value string

oint SetAttributeValue( const char* szKey, const char* szValue )
modify value of attribute in attribute map.

Parameters:
szKey - attribute key
szValue - attribute value
Returns:
if success, return HC_OK. otherwise return HC_ERROR.

oint AddAttributeValue( const char* szKey, const char* szValue )
add attribute to attribute map.

Parameters:
szKey - attribute key
szValue - attribute value
Returns:
if success, return HC_OK. otherwise return HC_ERROR.

ovoid SetContentLength( int iLength )
set length of body.

Parameters:
iLength - content-length


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.