mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Support http.getFile for URLs with query params
This commit is contained in:
@@ -249,7 +249,7 @@ export var test_getContentAsFile = function (done) {
|
||||
|
||||
// >> http-get-urlfile-content
|
||||
var filePath = fs.path.join(fs.knownFolders.documents().path, "test.png");
|
||||
http.getFile("https://httpbin.org/image/png", filePath).then(function (r) {
|
||||
http.getFile("https://httpbin.org/image/png?testQuery=query&anotherParam=param", filePath).then(function (r) {
|
||||
//// Argument (r) is File!
|
||||
// >> (hide)
|
||||
result = r;
|
||||
@@ -457,7 +457,7 @@ export var test_request_responseContentToImageShouldReturnCorrectImage = functio
|
||||
export var test_request_responseContentToFileFromUrlShouldReturnCorrectFile = function (done) {
|
||||
var result;
|
||||
|
||||
http.request({ url: "https://raw.githubusercontent.com/NativeScript/NativeScript/master/apps/tests/logo.png", method: "GET" }).then(function (response) {
|
||||
http.request({ url: "https://raw.githubusercontent.com/NativeScript/NativeScript/master/apps/app/ui-tests-app/image-view/red.png", method: "GET" }).then(function (response) {
|
||||
result = response.content.toFile();
|
||||
try {
|
||||
TKUnit.assert(result instanceof fs.File, "Result from toFile() should be valid File object!");
|
||||
@@ -474,7 +474,7 @@ export var test_request_responseContentToFileFromUrlShouldReturnCorrectFile = fu
|
||||
export var test_request_responseContentToFileFromContentShouldReturnCorrectFile = function (done) {
|
||||
var result;
|
||||
|
||||
http.request({ url: "https://httpbin.org/image/png", method: "GET" }).then(function (response) {
|
||||
http.request({ url: "https://httpbin.org/image/png?queryString=param&another=anotherParam", method: "GET" }).then(function (response) {
|
||||
result = response.content.toFile();
|
||||
try {
|
||||
TKUnit.assert(result instanceof fs.File, "Result from toFile() should be valid File object!");
|
||||
|
||||
Reference in New Issue
Block a user