annotate Core/RestApi/RestApi.cpp @ 402:d2c69150a979

bulk storescu
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Apr 2013 11:50:51 +0200
parents bdd72233b105
children 1188cb0ddaa5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
398
bdd72233b105 copyright update
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 355
diff changeset
3 * Copyright (C) 2012-2013 Medical Physics Department, CHU of Liege,
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Belgium
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * In addition, as a special exception, the copyright holders of this
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * program give permission to link the code of its release with the
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * that use the same license as the "OpenSSL" library), and distribute
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * the linked executables. You must obey the GNU General Public License
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * in all respects for all of the code used other than "OpenSSL". If you
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * modify file(s) with this exception, you may extend this exception to
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * your version of the file(s), but you are not obligated to do so. If
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * you do not wish to do so, delete this exception statement from your
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * version. If you delete this exception statement from all source files
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * in the program, then also delete it here.
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 *
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * This program is distributed in the hope that it will be useful, but
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * WITHOUT ANY WARRANTY; without even the implied warranty of
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * General Public License for more details.
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 *
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * You should have received a copy of the GNU General Public License
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 **/
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include "RestApi.h"
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
249
5694365ecb96 fixes for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 215
diff changeset
35 #include <stdlib.h> // To define "_exit()" under Windows
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
36 #include <glog/logging.h>
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
37
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 namespace Orthanc
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 {
331
5a96dac27959 base class for rest calls made public
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 304
diff changeset
40 bool RestApi::Call::ParseJsonRequestInternal(Json::Value& result,
5a96dac27959 base class for rest calls made public
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 304
diff changeset
41 const char* request)
304
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
42 {
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
43 result.clear();
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
44 Json::Reader reader;
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
45 return reader.parse(request, result);
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
46 }
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
47
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
48
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
49 bool RestApi::GetCall::ParseJsonRequest(Json::Value& result) const
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
50 {
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
51 result.clear();
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
52
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
53 for (HttpHandler::Arguments::const_iterator
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
54 it = getArguments_->begin(); it != getArguments_->end(); it++)
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
55 {
335
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 331
diff changeset
56 result[it->first] = it->second;
304
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
57 }
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
58
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
59 return true;
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
60 }
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
61
4eea080e6e7a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 249
diff changeset
62
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 bool RestApi::IsGetAccepted(const UriComponents& uri)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 for (GetHandlers::const_iterator it = getHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 it != getHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 if (it->first->Match(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 return true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 return false;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 bool RestApi::IsPutAccepted(const UriComponents& uri)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 for (PutHandlers::const_iterator it = putHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 it != putHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 if (it->first->Match(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 return true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 return false;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 bool RestApi::IsPostAccepted(const UriComponents& uri)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 for (PostHandlers::const_iterator it = postHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 it != postHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 if (it->first->Match(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 return true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 return false;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 bool RestApi::IsDeleteAccepted(const UriComponents& uri)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 for (DeleteHandlers::const_iterator it = deleteHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 it != deleteHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 if (it->first->Match(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 return true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 return false;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 static void AddMethod(std::string& target,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 const std::string& method)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 if (target.size() > 0)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 target += "," + method;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 else
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 target = method;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 std::string RestApi::GetAcceptedMethods(const UriComponents& uri)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 std::string s;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 if (IsGetAccepted(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 AddMethod(s, "GET");
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 if (IsPutAccepted(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 AddMethod(s, "PUT");
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 if (IsPostAccepted(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 AddMethod(s, "POST");
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 if (IsDeleteAccepted(uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 AddMethod(s, "DELETE");
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 return s;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 RestApi::~RestApi()
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 for (GetHandlers::iterator it = getHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 it != getHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 delete it->first;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 for (PutHandlers::iterator it = putHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 it != putHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 delete it->first;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 for (PostHandlers::iterator it = postHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 it != postHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 delete it->first;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 for (DeleteHandlers::iterator it = deleteHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 it != deleteHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 delete it->first;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 bool RestApi::IsServedUri(const UriComponents& uri)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 return (IsGetAccepted(uri) ||
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 IsPutAccepted(uri) ||
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 IsPostAccepted(uri) ||
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 IsDeleteAccepted(uri));
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 void RestApi::Handle(HttpOutput& output,
355
753e69f9326e refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
183 Orthanc_HttpMethod method,
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 const UriComponents& uri,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 const Arguments& headers,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 const Arguments& getArguments,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 const std::string& postData)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 bool ok = false;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 RestApiOutput restOutput(output);
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 RestApiPath::Components components;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 UriComponents trailing;
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
193
355
753e69f9326e refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
194 if (method == Orthanc_HttpMethod_Get)
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 for (GetHandlers::const_iterator it = getHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 it != getHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 if (it->first->Match(components, trailing, uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 {
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
201 LOG(INFO) << "REST GET call on: " << Toolbox::FlattenUri(uri);
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 ok = true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 GetCall call;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 call.output_ = &restOutput;
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
205 call.context_ = this;
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 call.httpHeaders_ = &headers;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 call.uriComponents_ = &components;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 call.trailing_ = &trailing;
215
c07170f3f4f7 refactoring of access to images in REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 210
diff changeset
209 call.fullUri_ = &uri;
c07170f3f4f7 refactoring of access to images in REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 210
diff changeset
210
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 call.getArguments_ = &getArguments;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 it->second(call);
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 }
355
753e69f9326e refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
216 else if (method == Orthanc_HttpMethod_Put)
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 for (PutHandlers::const_iterator it = putHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 it != putHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 if (it->first->Match(components, trailing, uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 {
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
223 LOG(INFO) << "REST PUT call on: " << Toolbox::FlattenUri(uri);
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 ok = true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 PutCall call;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 call.output_ = &restOutput;
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
227 call.context_ = this;
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 call.httpHeaders_ = &headers;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 call.uriComponents_ = &components;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 call.trailing_ = &trailing;
215
c07170f3f4f7 refactoring of access to images in REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 210
diff changeset
231 call.fullUri_ = &uri;
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 call.data_ = &postData;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 it->second(call);
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 }
355
753e69f9326e refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
238 else if (method == Orthanc_HttpMethod_Post)
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 for (PostHandlers::const_iterator it = postHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 it != postHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 if (it->first->Match(components, trailing, uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 {
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
245 LOG(INFO) << "REST POST call on: " << Toolbox::FlattenUri(uri);
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 ok = true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 PostCall call;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 call.output_ = &restOutput;
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
249 call.context_ = this;
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 call.httpHeaders_ = &headers;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 call.uriComponents_ = &components;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 call.trailing_ = &trailing;
215
c07170f3f4f7 refactoring of access to images in REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 210
diff changeset
253 call.fullUri_ = &uri;
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 call.data_ = &postData;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 it->second(call);
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 }
355
753e69f9326e refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 335
diff changeset
260 else if (method == Orthanc_HttpMethod_Delete)
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 for (DeleteHandlers::const_iterator it = deleteHandlers_.begin();
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 it != deleteHandlers_.end(); it++)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 if (it->first->Match(components, trailing, uri))
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 {
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
267 LOG(INFO) << "REST DELETE call on: " << Toolbox::FlattenUri(uri);
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 ok = true;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 DeleteCall call;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 call.output_ = &restOutput;
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
271 call.context_ = this;
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 call.httpHeaders_ = &headers;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 call.uriComponents_ = &components;
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 call.trailing_ = &trailing;
215
c07170f3f4f7 refactoring of access to images in REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 210
diff changeset
275 call.fullUri_ = &uri;
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 it->second(call);
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 if (!ok)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 {
210
96b7918a6a18 start of the refactoring of the Orthanc REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 209
diff changeset
283 LOG(INFO) << "REST method " << method << " not allowed on: " << Toolbox::FlattenUri(uri);
209
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 output.SendMethodNotAllowedError(GetAcceptedMethods(uri));
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 void RestApi::Register(const std::string& path,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 GetHandler handler)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 getHandlers_.push_back(std::make_pair(new RestApiPath(path), handler));
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 void RestApi::Register(const std::string& path,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 PutHandler handler)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 putHandlers_.push_back(std::make_pair(new RestApiPath(path), handler));
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 void RestApi::Register(const std::string& path,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 PostHandler handler)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 postHandlers_.push_back(std::make_pair(new RestApiPath(path), handler));
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 void RestApi::Register(const std::string& path,
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 DeleteHandler handler)
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 {
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 deleteHandlers_.push_back(std::make_pair(new RestApiPath(path), handler));
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 }
9960642f0f45 abstraction of RestApi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 }