mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
http client fixed to use new Image methods
This commit is contained in:
@@ -41,7 +41,7 @@ export var test_getImage = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export var test_getImage_fail = function () {
|
export var test_getImage_fail = function () {
|
||||||
http.getImage("htadvtp://www.google.com/images/errors/logo_sm_2.png").fail(function (e) {
|
http.getImage("htadvtp://www.google.com/images/errors/logo_sm_2.pngm").fail(function (e) {
|
||||||
TKUnit.assert(e instanceof Error, "Result from getImage().fail() should be Error!");
|
TKUnit.assert(e instanceof Error, "Result from getImage().fail() should be Error!");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export function request(options: http.HttpRequestOptions): promises.Promise<http
|
|||||||
raw: data,
|
raw: data,
|
||||||
toString: () => { return NSDataToString(data); },
|
toString: () => { return NSDataToString(data); },
|
||||||
toJSON: () => { return JSON.parse(NSDataToString(data)); },
|
toJSON: () => { return JSON.parse(NSDataToString(data)); },
|
||||||
toImage: () => { return require("Image/image").Image.imageFromData(data); }
|
toImage: () => { return require("Image/image").fromData(data); }
|
||||||
},
|
},
|
||||||
statusCode: response.statusCode(),
|
statusCode: response.statusCode(),
|
||||||
headers: headers
|
headers: headers
|
||||||
|
|||||||
Reference in New Issue
Block a user