23 #ifndef __MUSICBRAINZ3_WEBSERVICE_H__
24 #define __MUSICBRAINZ3_WEBSERVICE_H__
141 WebService(
const std::string &host =
"musicbrainz.org",
143 const std::string &pathPrefix =
"/ws",
144 const std::string &username = std::string(),
145 const std::string &password = std::string(),
146 const std::string &realm =
"musicbrainz.org");
158 void setHost(
const std::string &host);
165 std::string getHost()
const;
172 void setPort(
const int port);
186 void setPathPrefix(
const std::string &pathPrefix);
193 std::string getPathPrefix()
const;
200 void setUserName(
const std::string &username);
207 std::string getUserName()
const;
214 void setPassword(
const std::string &password);
221 std::string getPassword()
const;
228 void setRealm(
const std::string &realm);
235 std::string getRealm()
const;
242 void setProxyHost(
const std::string &host);
249 std::string getProxyHost()
const;
256 void setProxyPort(
const int port);
263 int getProxyPort()
const;
270 void setProxyUserName(
const std::string &username);
277 std::string getProxyUserName()
const;
284 void setProxyPassword(
const std::string &password);
291 std::string getProxyPassword()
const;
308 std::string
get(
const std::string &entity,
309 const std::string &id,
312 const std::string &version =
"1");
328 void post(
const std::string &entity,
329 const std::string &
id,
330 const std::string &data,
331 const std::string &version =
"1");
335 static int httpAuth(
void *userdata,
const char *realm,
int attempts,
336 char *username,
char *password);
337 static int proxyAuth(
void *userdata,
const char *realm,
int attempts,
338 char *username,
char *password);
339 static int httpResponseReader(
void *userdata,
const char *buf,
size_t len);
341 class WebServicePrivate;
342 WebServicePrivate *d;