MusicBrainz5::CHTTPFetch Class Reference

Object for make HTTP requests. More...

List of all members.

Public Member Functions

 CHTTPFetch (const std::string &UserAgent, const std::string &Host, int Port=80)
 Constructor.
 ~CHTTPFetch ()
void SetUserName (const std::string &UserName)
 Set the user name to use.
void SetPassword (const std::string &Password)
 Set the password to use.
void SetProxyHost (const std::string &ProxyHost)
 Set the proxy server to use.
void SetProxyPort (int ProxyPort)
 Set the proxy port to use.
void SetProxyUserName (const std::string &ProxyUserName)
 Set the proxy user name to use.
void SetProxyPassword (const std::string &ProxyPassword)
 Set the proxy password to use.
int Fetch (const std::string &URL, const std::string &Request="GET")
 Make a request to the server.
std::vector< unsigned char > Data () const
 Get the data receieved.
int Result () const
 libneon result code from the request
int Status () const
 Status.
std::string ErrorMessage () const
 Return the error message from the request.

Detailed Description

Object to be used to make HTTP requests


Constructor & Destructor Documentation

MusicBrainz5::CHTTPFetch::CHTTPFetch ( const std::string &  UserAgent,
const std::string &  Host,
int  Port = 80 
)

Constructor

Parameters:
UserAgent User agent string to send
Host Host name to connect to
Port Port to connect to (80 by default)
MusicBrainz5::CHTTPFetch::~CHTTPFetch (  ) 

Member Function Documentation

std::vector<unsigned char> MusicBrainz5::CHTTPFetch::Data (  )  const

Get the data received from the request

Returns:
Data received
std::string MusicBrainz5::CHTTPFetch::ErrorMessage (  )  const

Return the error message from the request

Returns:
Error message from the request
int MusicBrainz5::CHTTPFetch::Fetch ( const std::string &  URL,
const std::string &  Request = "GET" 
)

Make a request to the server

Parameters:
URL URL to request
Request Request type (GET by default)
Returns:
Number of bytes received
Exceptions:
CConnectionError An error occurred connecting to the web server
CTimeoutError A timeout occurred when connecting to the web server
CAuthenticationError An authentication error occurred
CFetchError An error occurred fetching data
CRequestError The request was invalid
CResourceNotFoundError The requested resource was not found
int MusicBrainz5::CHTTPFetch::Result (  )  const

Return the result code from the request

Returns:
libneon result code from the request
void MusicBrainz5::CHTTPFetch::SetPassword ( const std::string &  Password  ) 

Set the password to use when authenticating with the web server

Parameters:
Password Password to use
void MusicBrainz5::CHTTPFetch::SetProxyHost ( const std::string &  ProxyHost  ) 

Set the proxy server to use when connecting with the web server

Parameters:
ProxyHost Proxy server to use
void MusicBrainz5::CHTTPFetch::SetProxyPassword ( const std::string &  ProxyPassword  ) 

Set the password to use when authenticating with the proxy server

Parameters:
ProxyPassword Proxy server password to use
void MusicBrainz5::CHTTPFetch::SetProxyPort ( int  ProxyPort  ) 

Set the proxy server port to use when connecting to the web server

Parameters:
ProxyPort Proxy server port to use
void MusicBrainz5::CHTTPFetch::SetProxyUserName ( const std::string &  ProxyUserName  ) 

Set the user name to use when authenticating with the proxy server

Parameters:
ProxyUserName Proxy user name to use
void MusicBrainz5::CHTTPFetch::SetUserName ( const std::string &  UserName  ) 

Set the user name to use when authenticating with the web server

Parameters:
UserName User name to use
int MusicBrainz5::CHTTPFetch::Status (  )  const

Return the HTTP status code from the request

Returns:
HTTP status code from the request
Generated on Tue May 15 18:50:39 2012 for libmusicbrainz5 by  doxygen 1.6.3