diff OrthancCppClient/HttpClient.cpp @ 144:aa6c8a942952

http client password
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Oct 2012 14:39:38 +0200
parents 77aec9be0a51
children e3a40c7846b8
line wrap: on
line diff
--- a/OrthancCppClient/HttpClient.cpp	Thu Oct 11 13:02:32 2012 +0200
+++ b/OrthancCppClient/HttpClient.cpp	Thu Oct 11 14:39:38 2012 +0200
@@ -197,4 +197,12 @@
       return false;
     }
   }
+
+
+  void HttpClient::SetPassword(const char* username,
+			       const char* password)
+  {
+    std::string s = std::string(username) + ":" + std::string(password);
+    CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_USERPWD, s.c_str()));
+  }
 }