CkHttpResponse C++ Class Reference (Visual C++)

CkHttpResponse

Represents a complete HTTP response.

Properties

void get_Body(CkByteData &data);

The response body returned as a byte array.

void get_BodyStr(CkString &str);

The response body returned as a string.

void get_Charset(CkString &str);

The response charset, such as "iso-8859-1", if applicable. Obviously, responses for GIF and JPG files will not have a charset.

unsigned long get_ContentLength(void);

The content length of the response, in bytes.

__int64 get_ContentLength64(void);

To be documented soon...

void get_Date(SYSTEMTIME &sysTime);

The Date response header field, returned in an easy-to-use date/time data type.

void get_Domain(CkString &str);

The domain of the HTTP server that created this response.

void get_Header(CkString &str);

The full text of the response header.

int get_NumCookies(void);

The number of cookies included in the response.

int get_NumHeaderFields(void);

The number of response header fields.

int get_StatusCode(void);

The status code (as an integer) from the first line of an HTTP response. If the StatusLine = "HTTP/1.0 200 OK", the response status code returned is 200.

void get_StatusLine(CkString &str);

The first line of an HTTP response, such as "HTTP/1.0 200 OK".

bool get_Utf8(void) const;
void put_Utf8(bool b);

When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.

Methods

bool GetCookieDomain(int index, CkString & str);

Returns the domain of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns true for success, false for failure.

bool GetCookieExpires(int index, SYSTEMTIME & sysTime);

Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

bool GetCookieExpiresStr(int index, CkString & str);

Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns true for success, false for failure.

bool GetCookieName(int index, CkString & str);

Returns the name of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns true for success, false for failure.

bool GetCookiePath(int index, CkString & str);

Returns the path of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns true for success, false for failure.

bool GetCookieValue(int index, CkString & str);

Returns the value of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns true for success, false for failure.

bool GetHeaderField(const char * fieldName, CkString & str);

Returns the value of a response header field accessed by field name.

Returns true for success, false for failure.

bool GetHeaderFieldAttr(const char * fieldName, const char * attrName, CkString & str);

Returns a response header field attribute. As an example, the response charset is simply the GetHeaderFieldAttr("content-type","charset")

Returns true for success, false for failure.

bool GetHeaderName(int index, CkString & str);

Gets the name of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

Returns true for success, false for failure.

bool GetHeaderValue(int index, CkString & str);

Gets the value of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

Returns true for success, false for failure.

const char * bodyStr();

The response body returned as a string.

const char * charset();

The response charset, such as "iso-8859-1", if applicable. Obviously, responses for GIF and JPG files will not have a charset.

const char * domain();

The domain of the HTTP server that created this response.

const char * getCookieDomain(int index);

Returns the domain of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

const char * getCookieExpiresStr(int index);

Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

const char * getCookieName(int index);

Returns the name of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

const char * getCookiePath(int index);

Returns the path of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

const char * getCookieValue(int index);

Returns the value of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

const char * getHeaderField(const char * fieldName);

Returns the value of a response header field accessed by field name.

const char * getHeaderFieldAttr(const char * fieldName, const char * attrName);

Returns a response header field attribute. As an example, the response charset is simply the GetHeaderFieldAttr("content-type","charset")

const char * getHeaderName(int index);

Gets the name of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

const char * getHeaderValue(int index);

Gets the value of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

const char * header();

The full text of the response header.

const char * statusLine();

The first line of an HTTP response, such as "HTTP/1.0 200 OK".