25 #ifndef _MUSICBRAINZ5_HTTP_FETCH_
26 #define _MUSICBRAINZ5_HTTP_FETCH_
31 namespace MusicBrainz5
33 class CHTTPFetchPrivate;
38 CExceptionBase(
const std::string& ErrorMessage,
const std::string& Exception)
39 : m_ErrorMessage(ErrorMessage),
40 m_Exception(Exception)
42 m_FullMessage=m_Exception +
": " + m_ErrorMessage;
47 virtual const char*
what()
const throw()
49 return m_FullMessage.c_str();
53 std::string m_ErrorMessage;
54 std::string m_Exception;
55 std::string m_FullMessage;
156 CHTTPFetch(
const std::string& UserAgent,
const std::string& Host,
int Port=80);
237 int Fetch(
const std::string& URL,
const std::string& Request=
"GET");
247 std::vector<unsigned char>
Data()
const;
280 CHTTPFetchPrivate *
const m_d;
282 static int httpAuth(
void *userdata,
const char *realm,
int attempts,
char *username,
char *password);
283 static int proxyAuth(
void *userdata,
const char *realm,
int attempts,
char *username,
char *password);
284 static int httpResponseReader(
void *userdata,
const char *buf,
size_t len);