You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use the library in Android App. I have noticed that it always send POST request instead of GET request.
The reason is under com.amadeus/Request.java you have
protected void establishConnection() throws IOException {
this.connection = (HttpURLConnection) new URL(uri).openConnection();
connection.setRequestMethod(verb);
connection.setDoInput(true);
connection.setDoOutput(true);
So no matter setRequestMethod is, when setDoOutput=true, it always POST
According to https://developer.android.com/reference/java/net/HttpURLConnection
HTTP Methods
HttpURLConnection uses the GET method by default. It will use POST if setDoOutput(true) has been called. Other HTTP methods (OPTIONS, HEAD, PUT, DELETE and TRACE) can be used with setRequestMethod(String).
Suggestion fix:
connection.setDoOuput(true) only when the verb is POST
The text was updated successfully, but these errors were encountered:
Description
When I try to use the library in Android App. I have noticed that it always send POST request instead of GET request.
The reason is under com.amadeus/Request.java you have
protected void establishConnection() throws IOException {
this.connection = (HttpURLConnection) new URL(uri).openConnection();
connection.setRequestMethod(verb);
connection.setDoInput(true);
connection.setDoOutput(true);
So no matter setRequestMethod is, when setDoOutput=true, it always POST
According to https://developer.android.com/reference/java/net/HttpURLConnection
HTTP Methods
HttpURLConnection uses the GET method by default. It will use POST if setDoOutput(true) has been called. Other HTTP methods (OPTIONS, HEAD, PUT, DELETE and TRACE) can be used with setRequestMethod(String).
Suggestion fix:
connection.setDoOuput(true) only when the verb is POST
The text was updated successfully, but these errors were encountered: