@@ -37,7 +37,7 @@ protected HTTPClient(Configuration configuration) {
37
37
* @see Amadeus#get(String, Params)
38
38
*/
39
39
public Response get (String path ) throws ResponseException {
40
- return request (Constants .GET , path , null ,null );
40
+ return request (HttpVerbs .GET , path , null ,null );
41
41
}
42
42
43
43
/**
@@ -64,7 +64,7 @@ public Response get(String path) throws ResponseException {
64
64
* @return a Response object containing the status code, body, and parsed data.
65
65
*/
66
66
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 );
68
68
}
69
69
70
70
/**
@@ -91,7 +91,7 @@ public Response get(String path, Params params) throws ResponseException {
91
91
* @return a Response object containing the status code, body, and parsed data.
92
92
*/
93
93
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 );
95
95
}
96
96
97
97
/**
@@ -101,7 +101,7 @@ public Response delete(String path, Params params) throws ResponseException {
101
101
* @see Amadeus#delete(String, Params)
102
102
*/
103
103
public Response delete (String path ) throws ResponseException {
104
- return request (Constants .DELETE , path , null ,null );
104
+ return request (HttpVerbs .DELETE , path , null ,null );
105
105
}
106
106
107
107
/**
@@ -111,7 +111,7 @@ public Response delete(String path) throws ResponseException {
111
111
* @see Amadeus#post(String, Params)
112
112
*/
113
113
public Response post (String path ) throws ResponseException {
114
- return request (Constants .POST , path , null , null );
114
+ return request (HttpVerbs .POST , path , null , null );
115
115
}
116
116
117
117
/**
@@ -138,7 +138,7 @@ public Response post(String path) throws ResponseException {
138
138
* @return a Response object containing the status code, body, and parsed data.
139
139
*/
140
140
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 );
142
142
}
143
143
144
144
/**
@@ -165,7 +165,7 @@ public Response post(String path, Params params) throws ResponseException {
165
165
* @return a Response object containing the status code, body, and parsed data.
166
166
*/
167
167
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 );
169
169
}
170
170
171
171
/**
@@ -188,7 +188,7 @@ public Response post(String path, String body) throws ResponseException {
188
188
* @return a Response object containing the status code, body, and parsed data.
189
189
*/
190
190
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 ());
192
192
}
193
193
194
194
/**
@@ -212,7 +212,7 @@ public Response post(String path, JsonObject body) throws ResponseException {
212
212
* @return a Response object containing the status code, body, and parsed data.
213
213
*/
214
214
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 ());
216
216
}
217
217
218
218
/**
@@ -236,7 +236,7 @@ public Response post(String path, Params params, JsonObject body) throws Respons
236
236
* @return a Response object containing the status code, body, and parsed data.
237
237
*/
238
238
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 );
240
240
}
241
241
242
242
/**
@@ -246,7 +246,7 @@ public Response post(String path, Params params, String body) throws ResponseExc
246
246
*
247
247
* @hides as only used internally
248
248
*/
249
- public Response unauthenticatedRequest (String verb , String path , Params params , String body ,
249
+ public Response unauthenticatedRequest (HttpVerbs verb , String path , Params params , String body ,
250
250
String bearerToken ) throws ResponseException {
251
251
Request request = buildRequest (verb , path , params , body , bearerToken );
252
252
log (request );
@@ -334,13 +334,13 @@ public Resource[] last(Resource resource) throws ResponseException {
334
334
}
335
335
336
336
// 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 )
338
338
throws ResponseException {
339
339
return unauthenticatedRequest (verb , path , params , body , accessToken .getBearerToken ());
340
340
}
341
341
342
342
// 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 ,
344
344
String bearerToken ) {
345
345
return new Request (verb , path , params , body , bearerToken , this );
346
346
}
@@ -378,7 +378,7 @@ private Request fetch(Request request) throws NetworkException {
378
378
private void write (Request request ) throws IOException {
379
379
380
380
// 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
382
382
&& request .getBearerToken () != null ) {
383
383
OutputStream os = request .getConnection ().getOutputStream ();
384
384
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (os , "UTF-8" ));
@@ -392,7 +392,7 @@ private void write(Request request) throws IOException {
392
392
}
393
393
394
394
// 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
396
396
&& request .getBearerToken () == null ) {
397
397
OutputStream os = request .getConnection ().getOutputStream ();
398
398
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (os , "UTF-8" ));
@@ -403,7 +403,7 @@ private void write(Request request) throws IOException {
403
403
}
404
404
405
405
// POST with access token + body
406
- if (request .getVerb () == Constants .POST && request .getParams () == null ) {
406
+ if (request .getVerb () == HttpVerbs .POST && request .getParams () == null ) {
407
407
OutputStream os = request .getConnection ().getOutputStream ();
408
408
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (os , "UTF-8" ));
409
409
if (request .getBody () != null ) {
0 commit comments