diff --git a/android/widgets/src/main/java/org/nativescript/widgets/Async.java b/android/widgets/src/main/java/org/nativescript/widgets/Async.java index e1ce838f6..88c4a382a 100644 --- a/android/widgets/src/main/java/org/nativescript/widgets/Async.java +++ b/android/widgets/src/main/java/org/nativescript/widgets/Async.java @@ -386,8 +386,6 @@ public class Async public void readResponseStream(HttpURLConnection connection, Stack openedStreams, RequestOptions options) throws IOException { - this.statusCode = connection.getResponseCode(); - int contentLength = connection.getContentLength(); InputStream inStream; @@ -564,6 +562,7 @@ public class Async // build the result result.getHeaders(connection); result.url = options.url; + result.statusCode = connection.getResponseCode(); result.statusText = connection.getResponseMessage(); if (!requestMethod.equals(HEAD_METHOD)) { @@ -613,4 +612,4 @@ public class Async } } } -} +} \ No newline at end of file