@@ -37,7 +37,7 @@ protected HTTPClient(Configuration configuration) {
3737 * @see Amadeus#get(String, Params)
3838 */
3939 public Response get (String path ) throws ResponseException {
40- return request (Constants .GET , path , null ,null );
40+ return request (HttpVerbs .GET , path , null ,null );
4141 }
4242
4343 /**
@@ -64,7 +64,7 @@ public Response get(String path) throws ResponseException {
6464 * @return a Response object containing the status code, body, and parsed data.
6565 */
6666 public Response get (String path , Params params ) throws ResponseException {
67- return request (Constants .GET , path , params , null );
67+ return request (HttpVerbs .GET , path , params , null );
6868 }
6969
7070 /**
@@ -91,7 +91,7 @@ public Response get(String path, Params params) throws ResponseException {
9191 * @return a Response object containing the status code, body, and parsed data.
9292 */
9393 public Response delete (String path , Params params ) throws ResponseException {
94- return request (Constants .DELETE , path , params , null );
94+ return request (HttpVerbs .DELETE , path , params , null );
9595 }
9696
9797 /**
@@ -101,7 +101,7 @@ public Response delete(String path, Params params) throws ResponseException {
101101 * @see Amadeus#delete(String, Params)
102102 */
103103 public Response delete (String path ) throws ResponseException {
104- return request (Constants .DELETE , path , null ,null );
104+ return request (HttpVerbs .DELETE , path , null ,null );
105105 }
106106
107107 /**
@@ -111,7 +111,7 @@ public Response delete(String path) throws ResponseException {
111111 * @see Amadeus#post(String, Params)
112112 */
113113 public Response post (String path ) throws ResponseException {
114- return request (Constants .POST , path , null , null );
114+ return request (HttpVerbs .POST , path , null , null );
115115 }
116116
117117 /**
@@ -138,7 +138,7 @@ public Response post(String path) throws ResponseException {
138138 * @return a Response object containing the status code, body, and parsed data.
139139 */
140140 public Response post (String path , Params params ) throws ResponseException {
141- return request (Constants .POST , path , params , null );
141+ return request (HttpVerbs .POST , path , params , null );
142142 }
143143
144144 /**
@@ -165,7 +165,7 @@ public Response post(String path, Params params) throws ResponseException {
165165 * @return a Response object containing the status code, body, and parsed data.
166166 */
167167 public Response post (String path , String body ) throws ResponseException {
168- return request (Constants .POST , path , null , body );
168+ return request (HttpVerbs .POST , path , null , body );
169169 }
170170
171171 /**
@@ -188,7 +188,7 @@ public Response post(String path, String body) throws ResponseException {
188188 * @return a Response object containing the status code, body, and parsed data.
189189 */
190190 public Response post (String path , JsonObject body ) throws ResponseException {
191- return request (Constants .POST , path , null , body .toString ());
191+ return request (HttpVerbs .POST , path , null , body .toString ());
192192 }
193193
194194 /**
@@ -212,7 +212,7 @@ public Response post(String path, JsonObject body) throws ResponseException {
212212 * @return a Response object containing the status code, body, and parsed data.
213213 */
214214 public Response post (String path , Params params , JsonObject body ) throws ResponseException {
215- return request (Constants .POST , path , params , body .toString ());
215+ return request (HttpVerbs .POST , path , params , body .toString ());
216216 }
217217
218218 /**
@@ -236,7 +236,7 @@ public Response post(String path, Params params, JsonObject body) throws Respons
236236 * @return a Response object containing the status code, body, and parsed data.
237237 */
238238 public Response post (String path , Params params , String body ) throws ResponseException {
239- return request (Constants .POST , path , params , body );
239+ return request (HttpVerbs .POST , path , params , body );
240240 }
241241
242242 /**
@@ -246,7 +246,7 @@ public Response post(String path, Params params, String body) throws ResponseExc
246246 *
247247 * @hides as only used internally
248248 */
249- public Response unauthenticatedRequest (String verb , String path , Params params , String body ,
249+ public Response unauthenticatedRequest (HttpVerbs verb , String path , Params params , String body ,
250250 String bearerToken ) throws ResponseException {
251251 Request request = buildRequest (verb , path , params , body , bearerToken );
252252 log (request );
@@ -334,13 +334,13 @@ public Resource[] last(Resource resource) throws ResponseException {
334334 }
335335
336336 // A generic method for making requests of any verb.
337- protected Response request (String verb , String path , Params params , String body )
337+ protected Response request (HttpVerbs verb , String path , Params params , String body )
338338 throws ResponseException {
339339 return unauthenticatedRequest (verb , path , params , body , accessToken .getBearerToken ());
340340 }
341341
342342 // Builds a request
343- protected Request buildRequest (String verb , String path , Params params , String body ,
343+ protected Request buildRequest (HttpVerbs verb , String path , Params params , String body ,
344344 String bearerToken ) {
345345 return new Request (verb , path , params , body , bearerToken , this );
346346 }
@@ -378,7 +378,7 @@ private Request fetch(Request request) throws NetworkException {
378378 private void write (Request request ) throws IOException {
379379
380380 // POST with access token + body + URL parameters
381- if (request .getVerb () == Constants .POST && request .getParams () != null
381+ if (request .getVerb () == HttpVerbs .POST && request .getParams () != null
382382 && request .getBearerToken () != null ) {
383383 OutputStream os = request .getConnection ().getOutputStream ();
384384 BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (os , "UTF-8" ));
@@ -392,7 +392,7 @@ private void write(Request request) throws IOException {
392392 }
393393
394394 // POST with access without token (authentication call)
395- if (request .getVerb () == Constants .POST && request .getParams () != null
395+ if (request .getVerb () == HttpVerbs .POST && request .getParams () != null
396396 && request .getBearerToken () == null ) {
397397 OutputStream os = request .getConnection ().getOutputStream ();
398398 BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (os , "UTF-8" ));
@@ -403,7 +403,7 @@ private void write(Request request) throws IOException {
403403 }
404404
405405 // POST with access token + body
406- if (request .getVerb () == Constants .POST && request .getParams () == null ) {
406+ if (request .getVerb () == HttpVerbs .POST && request .getParams () == null ) {
407407 OutputStream os = request .getConnection ().getOutputStream ();
408408 BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (os , "UTF-8" ));
409409 if (request .getBody () != null ) {
0 commit comments