changeset 3426:00737cd21f40

OrthancPlugins::HttpClient::AddHeaders()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jun 2019 17:52:36 +0200
parents 2f6dcb9c8cc1
children 3ff4f07806eb
files Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Plugins/Samples/Common/OrthancPluginCppWrapper.h
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Fri Jun 14 15:21:19 2019 +0200
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Fri Jun 14 17:52:36 2019 +0200
@@ -2222,6 +2222,16 @@
   {
   }
 
+
+  void HttpClient::AddHeaders(const HttpHeaders& headers)
+  {
+    for (HttpHeaders::const_iterator it = headers.begin();
+         it != headers.end(); ++it)
+    {
+      headers_[it->first] = it->second;
+    }
+  }
+
   
   void HttpClient::SetCredentials(const std::string& username,
                                   const std::string& password)
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Fri Jun 14 15:21:19 2019 +0200
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Fri Jun 14 17:52:36 2019 +0200
@@ -889,6 +889,8 @@
       headers_[key] = value;
     }
 
+    void AddHeaders(const HttpHeaders& headers);
+
     void SetCredentials(const std::string& username,
                         const std::string& password);