mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
add 'url' and 'statusText' properties to result object from Async Http requests
This commit is contained in:
@@ -347,6 +347,8 @@ public class Async
|
|||||||
public String responseAsString;
|
public String responseAsString;
|
||||||
public Bitmap responseAsImage;
|
public Bitmap responseAsImage;
|
||||||
public Exception error;
|
public Exception error;
|
||||||
|
public String url;
|
||||||
|
public String statusText;
|
||||||
|
|
||||||
public void getHeaders(HttpURLConnection connection)
|
public void getHeaders(HttpURLConnection connection)
|
||||||
{
|
{
|
||||||
@@ -542,6 +544,8 @@ public class Async
|
|||||||
|
|
||||||
// build the result
|
// build the result
|
||||||
result.getHeaders(connection);
|
result.getHeaders(connection);
|
||||||
|
result.url = options.url;
|
||||||
|
result.statusText = connection.getResponseMessage();
|
||||||
if (!requestMethod.equals(HEAD_METHOD))
|
if (!requestMethod.equals(HEAD_METHOD))
|
||||||
{
|
{
|
||||||
result.readResponseStream(connection, openedStreams, options);
|
result.readResponseStream(connection, openedStreams, options);
|
||||||
|
|||||||
Reference in New Issue
Block a user