comparison Plugins/Samples/Common/OrthancHttpConnection.cpp @ 2183:1d0838b8e9c5

RestApiDelete and RestApiPut
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Nov 2016 21:33:35 +0100
parents de32f3b4ff09
children a3a65de1840f
comparison
equal deleted inserted replaced
2182:085a41c66133 2183:1d0838b8e9c5
77 client_.SetMethod(Orthanc::HttpMethod_Post); 77 client_.SetMethod(Orthanc::HttpMethod_Post);
78 client_.SetUrl(url_ + uri); 78 client_.SetUrl(url_ + uri);
79 client_.SetBody(body); 79 client_.SetBody(body);
80 client_.ApplyAndThrowException(result); 80 client_.ApplyAndThrowException(result);
81 } 81 }
82
83
84 void OrthancHttpConnection::RestApiPut(std::string& result,
85 const std::string& uri,
86 const std::string& body)
87 {
88 boost::mutex::scoped_lock lock(mutex_);
89
90 client_.SetMethod(Orthanc::HttpMethod_Put);
91 client_.SetUrl(url_ + uri);
92 client_.SetBody(body);
93 client_.ApplyAndThrowException(result);
94 }
95
96
97 void OrthancHttpConnection::RestApiDelete(const std::string& uri)
98 {
99 boost::mutex::scoped_lock lock(mutex_);
100
101 std::string result;
102
103 client_.SetMethod(Orthanc::HttpMethod_Delete);
104 client_.SetUrl(url_ + uri);
105 client_.ApplyAndThrowException(result);
106 }
82 } 107 }