url with % fixed

It seems that this url is a special case since url encoding techniques
failed for both ios and android.
For ios:
stringByAddingPercentEscapesUsingEncoding
stringByAddingPercentEncodingWithAllowedCharacters
For android:
java.net.URLEncoder
This commit is contained in:
Vladimir Enchev
2015-12-10 14:42:04 +02:00
parent 06c164c747
commit 66ec3f2f20
3 changed files with 5 additions and 3 deletions

View File

@ -534,7 +534,8 @@ export var test_getString_FromVariousUrls_ShouldWorkProperly = function (done) {
var urls = [
"https://it-ebooks-api.info/v1/book/1615005640",
"https://www.telerik.com",
"https://spreadsheets.google.com/tq?key=1tJ64Y8hje0ui4ap9U33h3KWwpxT_-JuVMSZzxD2Er8k"
"https://spreadsheets.google.com/tq?key=1tJ64Y8hje0ui4ap9U33h3KWwpxT_-JuVMSZzxD2Er8k",
"https://chase.arborgoldcloud.net/mobilehandler/mobiledatahandler.ashx?ProcedureName=MEstimGetJobListSpeed&@prmSalesRep=%&@prmStartDate=11/1/2015&@prmEndDate=12/8/2015&@prmStatusFilter=2"
];
var i: number;

View File

@ -75,7 +75,8 @@ function buildJavaOptions(options: http.HttpRequestOptions) {
var javaOptions = new com.tns.Async.Http.RequestOptions();
javaOptions.url = options.url;
javaOptions.url = options.url.replace("%", "%25");
if (types.isString(options.method)) {
javaOptions.method = options.method;
}

View File

@ -20,7 +20,7 @@ export function request(options: http.HttpRequestOptions): Promise<http.HttpResp
sessionConfig, null, queue);
var urlRequest = NSMutableURLRequest.requestWithURL(
NSURL.URLWithString(options.url));
NSURL.URLWithString(options.url.replace("%", "%25")));
urlRequest.HTTPMethod = types.isDefined(options.method) ? options.method : GET;