BazisLib::Network::HTTP::HTTPClient Class Reference

Allows retrieving files over HTTP [thread-safe]. More...

#include <http.h>

Inherited by BazisLib::Network::HTTP::AutoHTTPClient.

Collaboration diagram for BazisLib::Network::HTTP::HTTPClient:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 HTTPClient ()
ActionStatus RetreiveFileEx (const std::string &URL, ManagedPointer< AIFile > file, ULONGLONG StartingOffset, ULONGLONG EndingOffset, PNETPROGRESSPROC pProgress=0, void *pContext=0)
 Executes a GET request with an arbitrary data range.
ActionStatus RetreiveFile (const std::string &URL, ManagedPointer< AIFile > file, PNETPROGRESSPROC pProgress=0, void *pContext=0)
 Executes a simple GET request.
ActionStatus QueryFileInfo (const std::string &URL, CHTTPReplyHeader *pHeader)
 Executes a HEAD request.
ActionStatus PostRequest (const std::string &URL, const CBuffer &RequestBody, ManagedPointer< AIFile > file, PNETPROGRESSPROC pProgress=0, void *pContext=0)
 Executes a POST request.
ActionStatus SetProxy (const std::string &Proxy="")
void SetTimeout (unsigned Timeout=0)
unsigned GetTimeout ()

Protected Member Functions

ManagedPointer< CHTTPReplyStreamCreateStream (const std::string &URL, const std::string &Login, const std::string &Password, ULONGLONG StartingOffset=-1LL, ULONGLONG EndingOffset=0LL, unsigned *pHTTPResultCode=NULL, const CBuffer *pPostRequestBody=NULL, PNETPROGRESSPROC pProgress=NULL, void *pContext=NULL, ActionStatus *pStatus=NULL, unsigned ReportedThreadID=NULL, bool *pRetryPossible=NULL, bool *pResultIsNonSeekable=NULL, const ConstManagedPointer< ACHTTPRequest > *ppRequestOverride=NULL)
 Executes a GET or POST request and returns a pointer to a reply stream.

Protected Attributes

CCookieManager m_CookieMgr
std::string m_ProxyHost
std::string m_ProxyLogin
std::string m_ProxyPassword
unsigned m_ProxyPort
unsigned m_Timeout
InProcessMutex m_ProxyMutex


Detailed Description

Allows retrieving files over HTTP [thread-safe].

This class allows executing HTTP requests: GET, POST and HEAD. For extended functionality, such as HTTP-based file objects, use the AutoHTTPClient class.


Constructor & Destructor Documentation

BazisLib::Network::HTTP::HTTPClient::HTTPClient (  )  [inline]


Member Function Documentation

ManagedPointer<CHTTPReplyStream> BazisLib::Network::HTTP::HTTPClient::CreateStream ( const std::string &  URL,
const std::string &  Login,
const std::string &  Password,
ULONGLONG  StartingOffset = -1LL,
ULONGLONG  EndingOffset = 0LL,
unsigned *  pHTTPResultCode = NULL,
const CBuffer pPostRequestBody = NULL,
PNETPROGRESSPROC  pProgress = NULL,
void *  pContext = NULL,
ActionStatus pStatus = NULL,
unsigned  ReportedThreadID = NULL,
bool *  pRetryPossible = NULL,
bool *  pResultIsNonSeekable = NULL,
const ConstManagedPointer< ACHTTPRequest > *  ppRequestOverride = NULL 
) [protected]

Executes a GET or POST request and returns a pointer to a reply stream.

Parameters:
pResultIsNonSeekable If this pointer is not NULL, the CreateStream() method will NOT fail if the server does not support resuming and the download was requested from the very beginning. Instead, the variable pointed by this parameter will be set to true.
Attention:
Always check the state of the variable pointed by pResultIsNonSeekable (if it is non-NULL) after the function returns. Otherwise you may confuse a non-seekable stream for seekable.

unsigned BazisLib::Network::HTTP::HTTPClient::GetTimeout (  )  [inline]

ActionStatus BazisLib::Network::HTTP::HTTPClient::PostRequest ( const std::string &  URL,
const CBuffer RequestBody,
ManagedPointer< AIFile file,
PNETPROGRESSPROC  pProgress = 0,
void *  pContext = 0 
)

Executes a POST request.

ActionStatus BazisLib::Network::HTTP::HTTPClient::QueryFileInfo ( const std::string &  URL,
CHTTPReplyHeader pHeader 
)

Executes a HEAD request.

ActionStatus BazisLib::Network::HTTP::HTTPClient::RetreiveFile ( const std::string &  URL,
ManagedPointer< AIFile file,
PNETPROGRESSPROC  pProgress = 0,
void *  pContext = 0 
) [inline]

Executes a simple GET request.

Here is the call graph for this function:

ActionStatus BazisLib::Network::HTTP::HTTPClient::RetreiveFileEx ( const std::string &  URL,
ManagedPointer< AIFile file,
ULONGLONG  StartingOffset,
ULONGLONG  EndingOffset,
PNETPROGRESSPROC  pProgress = 0,
void *  pContext = 0 
)

Executes a GET request with an arbitrary data range.

ActionStatus BazisLib::Network::HTTP::HTTPClient::SetProxy ( const std::string &  Proxy = ""  ) 

void BazisLib::Network::HTTP::HTTPClient::SetTimeout ( unsigned  Timeout = 0  )  [inline]


Member Data Documentation


The documentation for this class was generated from the following file:
SourceForge.net Logo