Mercurial > hg > orthanc
comparison OrthancFramework/Sources/HttpServer/HttpToolbox.cpp @ 4605:c8f444e8556d
new function in the plugin SDK: OrthancPluginCallRestApi()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Mar 2021 16:34:02 +0200 |
parents | d9473bd5ed43 |
children | 7053502fbf97 |
comparison
equal
deleted
inserted
replaced
4597:b7fe3494a53c | 4605:c8f444e8556d |
---|---|
189 IHttpHandler& handler, | 189 IHttpHandler& handler, |
190 RequestOrigin origin, | 190 RequestOrigin origin, |
191 const std::string& uri, | 191 const std::string& uri, |
192 const Arguments& httpHeaders) | 192 const Arguments& httpHeaders) |
193 { | 193 { |
194 return IHttpHandler::SimpleGet(result, handler, origin, uri, httpHeaders); | 194 return (IHttpHandler::SimpleGet(result, NULL, handler, origin, uri, httpHeaders) == HttpStatus_200_Ok); |
195 } | 195 } |
196 | 196 |
197 bool HttpToolbox::SimplePost(std::string& result, | 197 bool HttpToolbox::SimplePost(std::string& result, |
198 IHttpHandler& handler, | 198 IHttpHandler& handler, |
199 RequestOrigin origin, | 199 RequestOrigin origin, |
200 const std::string& uri, | 200 const std::string& uri, |
201 const void* bodyData, | 201 const void* bodyData, |
202 size_t bodySize, | 202 size_t bodySize, |
203 const Arguments& httpHeaders) | 203 const Arguments& httpHeaders) |
204 { | 204 { |
205 return IHttpHandler::SimplePost(result, handler, origin, uri, bodyData, bodySize, httpHeaders); | 205 return (IHttpHandler::SimplePost(result, NULL, handler, origin, uri, |
206 bodyData, bodySize, httpHeaders) == HttpStatus_200_Ok); | |
206 } | 207 } |
207 | 208 |
208 bool HttpToolbox::SimplePut(std::string& result, | 209 bool HttpToolbox::SimplePut(std::string& result, |
209 IHttpHandler& handler, | 210 IHttpHandler& handler, |
210 RequestOrigin origin, | 211 RequestOrigin origin, |
211 const std::string& uri, | 212 const std::string& uri, |
212 const void* bodyData, | 213 const void* bodyData, |
213 size_t bodySize, | 214 size_t bodySize, |
214 const Arguments& httpHeaders) | 215 const Arguments& httpHeaders) |
215 { | 216 { |
216 return IHttpHandler::SimplePut(result, handler, origin, uri, bodyData, bodySize, httpHeaders); | 217 return (IHttpHandler::SimplePut(result, NULL, handler, origin, uri, |
218 bodyData, bodySize, httpHeaders) == HttpStatus_200_Ok); | |
217 } | 219 } |
218 | 220 |
219 bool HttpToolbox::SimpleDelete(IHttpHandler& handler, | 221 bool HttpToolbox::SimpleDelete(IHttpHandler& handler, |
220 RequestOrigin origin, | 222 RequestOrigin origin, |
221 const std::string& uri, | 223 const std::string& uri, |
222 const Arguments& httpHeaders) | 224 const Arguments& httpHeaders) |
223 { | 225 { |
224 return IHttpHandler::SimpleDelete(handler, origin, uri, httpHeaders); | 226 return (IHttpHandler::SimpleDelete(NULL, handler, origin, uri, httpHeaders) == HttpStatus_200_Ok); |
225 } | 227 } |
226 #endif | 228 #endif |
227 } | 229 } |