Skip to content

Commit 10420f1

Browse files
author
Anthony Roux
committed
Fix Issue #21 - HTTPURLConnection nor working well on Android
1 parent 709c7d5 commit 10420f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/amadeus/Request.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ protected void establishConnection() throws IOException {
106106
this.connection = (HttpURLConnection) new URL(uri).openConnection();
107107
connection.setRequestMethod(verb);
108108
connection.setDoInput(true);
109-
connection.setDoOutput(true);
109+
if (verb == Constants.POST) {
110+
connection.setDoOutput(true);
111+
}
110112
for (Map.Entry<String, String> entry : headers.entrySet()) {
111113
connection.setRequestProperty(entry.getKey(), entry.getValue());
112114
}

0 commit comments

Comments
 (0)