@@ -148,7 +148,7 @@ public Response get(Request request) throws URISyntaxException, IOException {
148148 HttpGet httpGet = null ;
149149
150150 try {
151- uri = buildUri (request .baseUri , request .endpoint , request .getQueryParams ());
151+ uri = buildUri (request .getBaseUri () , request .getEndpoint () , request .getQueryParams ());
152152 httpGet = new HttpGet (uri .toString ());
153153 } catch (URISyntaxException ex ) {
154154 throw ex ;
@@ -171,7 +171,7 @@ public Response post(Request request) throws URISyntaxException, IOException {
171171 HttpPost httpPost = null ;
172172
173173 try {
174- uri = buildUri (request .baseUri , request .endpoint , request .getQueryParams ());
174+ uri = buildUri (request .getBaseUri () , request .getEndpoint () , request .getQueryParams ());
175175 httpPost = new HttpPost (uri .toString ());
176176 } catch (URISyntaxException ex ) {
177177 throw ex ;
@@ -183,8 +183,8 @@ public Response post(Request request) throws URISyntaxException, IOException {
183183 }
184184 }
185185
186- httpPost .setEntity (new StringEntity (request .body , Charset .forName ("UTF-8" )));
187- if (request .body != "" ) {
186+ httpPost .setEntity (new StringEntity (request .getBody () , Charset .forName ("UTF-8" )));
187+ if (request .getBody () != "" ) {
188188 httpPost .setHeader ("Content-Type" , "application/json" );
189189 }
190190
@@ -200,7 +200,7 @@ public Response patch(Request request) throws URISyntaxException, IOException {
200200 HttpPatch httpPatch = null ;
201201
202202 try {
203- uri = buildUri (request .baseUri , request .endpoint , request .getQueryParams ());
203+ uri = buildUri (request .getBaseUri () , request .getEndpoint () , request .getQueryParams ());
204204 httpPatch = new HttpPatch (uri .toString ());
205205 } catch (URISyntaxException ex ) {
206206 throw ex ;
@@ -212,8 +212,8 @@ public Response patch(Request request) throws URISyntaxException, IOException {
212212 }
213213 }
214214
215- httpPatch .setEntity (new StringEntity (request .body , Charset .forName ("UTF-8" )));
216- if (request .body != "" ) {
215+ httpPatch .setEntity (new StringEntity (request .getBody () , Charset .forName ("UTF-8" )));
216+ if (request .getBody () != "" ) {
217217 httpPatch .setHeader ("Content-Type" , "application/json" );
218218 }
219219 return executeApiCall (httpPatch );
@@ -228,7 +228,7 @@ public Response put(Request request) throws URISyntaxException, IOException {
228228 HttpPut httpPut = null ;
229229
230230 try {
231- uri = buildUri (request .baseUri , request .endpoint , request .getQueryParams ());
231+ uri = buildUri (request .getBaseUri () , request .getEndpoint () , request .getQueryParams ());
232232 httpPut = new HttpPut (uri .toString ());
233233 } catch (URISyntaxException ex ) {
234234 throw ex ;
@@ -240,8 +240,8 @@ public Response put(Request request) throws URISyntaxException, IOException {
240240 }
241241 }
242242
243- httpPut .setEntity (new StringEntity (request .body , Charset .forName ("UTF-8" )));
244- if (request .body != "" ) {
243+ httpPut .setEntity (new StringEntity (request .getBody () , Charset .forName ("UTF-8" )));
244+ if (request .getBody () != "" ) {
245245 httpPut .setHeader ("Content-Type" , "application/json" );
246246 }
247247
@@ -256,7 +256,7 @@ public Response delete(Request request) throws URISyntaxException, IOException {
256256 HttpDeleteWithBody httpDelete = null ;
257257
258258 try {
259- uri = buildUri (request .baseUri , request .endpoint , request .getQueryParams ());
259+ uri = buildUri (request .getBaseUri () , request .getEndpoint () , request .getQueryParams ());
260260 httpDelete = new HttpDeleteWithBody (uri .toString ());
261261 } catch (URISyntaxException ex ) {
262262 throw ex ;
@@ -268,8 +268,8 @@ public Response delete(Request request) throws URISyntaxException, IOException {
268268 }
269269 }
270270
271- httpDelete .setEntity (new StringEntity (request .body , Charset .forName ("UTF-8" )));
272- if (request .body != "" ) {
271+ httpDelete .setEntity (new StringEntity (request .getBody () , Charset .forName ("UTF-8" )));
272+ if (request .getBody () != "" ) {
273273 httpDelete .setHeader ("Content-Type" , "application/json" );
274274 }
275275
@@ -301,10 +301,10 @@ private Response executeApiCall(HttpRequestBase httpPost) throws IOException {
301301 */
302302 public Response api (Request request ) throws IOException {
303303 try {
304- if (request .method == null ) {
304+ if (request .getMethod () == null ) {
305305 throw new IOException ("We only support GET, PUT, PATCH, POST and DELETE." );
306306 }
307- switch (request .method ) {
307+ switch (request .getMethod () ) {
308308 case GET :
309309 return get (request );
310310 case POST :
0 commit comments