fix(ui-mobile-base): Android http request body was not sent if method was DELETE (#9887)

This commit is contained in:
Dimitris - Rafail Katsampas
2022-04-30 20:41:04 +03:00
committed by Nathan Walker
parent cd5d2c2f4d
commit 57e4973da5

View File

@ -285,7 +285,6 @@ public class Async {
}
public static class Http {
private static final String DELETE_METHOD = "DELETE";
private static final String GET_METHOD = "GET";
private static final String HEAD_METHOD = "HEAD";
private static CookieManager cookieManager;
@ -537,10 +536,7 @@ public class Async {
connection.setInstanceFollowRedirects(false);
}
// Do not attempt to write the content (body) for DELETE method, Java will throw directly
if (!requestMethod.equals(DELETE_METHOD)) {
options.writeContent(connection, openedStreams);
}
options.writeContent(connection, openedStreams);
// close the opened streams (saves copy-paste implementation
// in each method that throws IOException)