WeHttpResponse Class Reference

HTTP response. More...

#include <weHTTP.h>

Inheritance diagram for WeHttpResponse:

iweResponse iweOperation

List of all members.

Public Member Functions

 WeHttpResponse ()
 Default constructor.
 ~WeHttpResponse ()
 Destructor.
WeStringLinksHeaders (void)
 HTTP headers of the document.
WeStringLinksCookies (void)
 HTTP cookies of the document.
void CurlSetOpts (WeHttpRequest *req=NULL)
 Sets the options of CURL handle.
const CURLcode & GetLastError (void) const
 Gets the CURLcode - the last cURL operation status.
const char * GetErrorMessage (void) const
 Gets the human readable error message.
bool CurlInit (void)
 Gets the human readable error message.
void Process (iweTransport *proc)
int HttpCode (void)
 HTTP response code for the document.
void HttpCode (int code)
 HTTP response code for the document.
CURL * CURLHandle (void)
 cURL transfer handle

Static Protected Member Functions

static size_t Receiver (void *ptr, size_t size, size_t nmemb, void *ourpointer)
 Receives the document body.
static size_t HeadersRecv (void *ptr, size_t size, size_t nmemb, void *ourpointer)
 Receives the document headers.


Detailed Description

HTTP response.

Just the HTTP response - code and header and unstructured data. To structure the response data use the WeDocument instead.

Author:
A. Abramov
Date:
29.05.2009
Examples:

httpget.cpp.

Definition at line 60 of file weHTTP.h.


Constructor & Destructor Documentation

WeHttpResponse::WeHttpResponse (  ) 

Default constructor.

Exceptions:
WeError if curl_easy_init failed

Definition at line 32 of file weHttpResp.cpp.

WeHttpResponse::~WeHttpResponse (  ) 

Destructor.

Definition at line 53 of file weHttpResp.cpp.


Member Function Documentation

WeStringLinks& WeHttpResponse::Cookies ( void   )  [inline]

HTTP cookies of the document.

Definition at line 74 of file weHTTP.h.

CURL* WeHttpResponse::CURLHandle ( void   )  [inline]

cURL transfer handle

Definition at line 87 of file weHTTP.h.

bool WeHttpResponse::CurlInit ( void   ) 

Gets the human readable error message.

CURL initialize.

Return values:
true if it succeeds, false if it fails.

Todo:
reset handle without recreate connection

Definition at line 69 of file weHttpResp.cpp.

void WeHttpResponse::CurlSetOpts ( WeHttpRequest req = NULL  ) 

Sets the options of CURL handle.

Parameters:
req - The WeHttpRequest, if not NULL - sets the request options, else sets only default options

Todo:
Sets the request options

Definition at line 92 of file weHttpResp.cpp.

const char* WeHttpResponse::GetErrorMessage ( void   )  const [inline]

Gets the human readable error message.

Definition at line 105 of file weHTTP.h.

const CURLcode& WeHttpResponse::GetLastError ( void   )  const [inline]

Gets the CURLcode - the last cURL operation status.

Definition at line 100 of file weHTTP.h.

WeStringLinks& WeHttpResponse::Headers ( void   )  [inline]

HTTP headers of the document.

Definition at line 69 of file weHTTP.h.

size_t WeHttpResponse::HeadersRecv ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  ourpointer 
) [static, protected]

Receives the document headers.

Parameters:
ptr - The pointer to received data.
size - The size of the data element.
nmemb - The number of the elements in the data.
ourpointer - The pointer to the WeHttpResponse object, that receives data.
Return values:
amount of processed data

Definition at line 188 of file weHttpResp.cpp.

void WeHttpResponse::HttpCode ( int  code  )  [inline]

HTTP response code for the document.

Definition at line 81 of file weHTTP.h.

int WeHttpResponse::HttpCode ( void   )  [inline]

HTTP response code for the document.

Examples:
httpget.cpp.

Definition at line 80 of file weHTTP.h.

void WeHttpResponse::Process ( iweTransport proc  )  [virtual]

lastError = curl_easy_getinfo(curlHandle, CURLINFO_REDIRECT_COUNT, &relocCount);

Todo:
Process options

Todo:
process options: weoStayInDomain, weoStayInHost, weoStayInDir and request blocking

Implements iweResponse.

Definition at line 118 of file weHttpResp.cpp.

size_t WeHttpResponse::Receiver ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  ourpointer 
) [static, protected]

Receives the document body.

Parameters:
ptr - The pointer to received data.
size - The size of the data element.
nmemb - The number of the elements in the data.
ourpointer - The pointer to the WeHttpResponse object, that receives data.
Return values:
amount of processed data

Definition at line 164 of file weHttpResp.cpp.


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


 
©2009 Positive Technologies
 
Generated on Tue Jul 14 18:27:31 2009 for WebEngine by 
 
 
1.5.7
 
Get wpcObj at SourceForge.net. Fast, secure and Free Open Source software downloads