comparison Core/HttpClient.cpp @ 2020:a0bd8cd55da7

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 15 Jun 2016 17:19:10 +0200
parents 9c9332e486ca
children fefbe71c2272
comparison
equal deleted inserted replaced
2019:9c9332e486ca 2020:a0bd8cd55da7
238 GlobalParameters::GetInstance().GetDefaultProxy(proxy_); 238 GlobalParameters::GetInstance().GetDefaultProxy(proxy_);
239 GlobalParameters::GetInstance().GetSslConfiguration(verifyPeers_, caCertificates_); 239 GlobalParameters::GetInstance().GetSslConfiguration(verifyPeers_, caCertificates_);
240 } 240 }
241 241
242 242
243 HttpClient::HttpClient() : pimpl_(new PImpl), verifyPeers_(true) 243 HttpClient::HttpClient() :
244 pimpl_(new PImpl),
245 verifyPeers_(true)
244 { 246 {
245 Setup(); 247 Setup();
248 }
249
250
251 HttpClient::HttpClient(const WebServiceParameters& service,
252 const std::string& uri) :
253 pimpl_(new PImpl),
254 verifyPeers_(true)
255 {
256 Setup();
257
258 if (service.GetUsername().size() != 0 &&
259 service.GetPassword().size() != 0)
260 {
261 SetCredentials(service.GetUsername().c_str(),
262 service.GetPassword().c_str());
263 }
264
265 if (!service.GetCertificateFile().empty())
266 {
267 SetClientCertificate(service.GetCertificateFile(),
268 service.GetCertificateKeyFile(),
269 service.GetCertificateKeyPassword());
270 }
271
272 SetUrl(service.GetUrl() + uri);
246 } 273 }
247 274
248 275
249 HttpClient::~HttpClient() 276 HttpClient::~HttpClient()
250 { 277 {