如何创建一个在 Titanium 中传递不同值的请求字符串? [英] How to create a request string with passing different values in Titanium?

查看:20
本文介绍了如何创建一个在 Titanium 中传递不同值的请求字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个这样的 URL 字符串:

I am creating a URL-String like this:

URLString = %@sale-ws/lots/sales?yardNumber=%@&saleFromDate=%@&range=%@&saleToDate=%@&pageSize=%@&pageNo=%@&sortBy=%@&sortType=%@&filterStartYear=%@&filterEndYear=%@&filterMake=%@&filterModel=%@&filterLocationId=%@&filterLane=%@&filterSellerId=%@&searchInSearchString=%@

所以在 Titanium 中,我想将值动态传递到给定的字符串中.我试过这个,但没有得到正确的回应.

So in Titanium i want to pass the values dynamically into a given string. I tried this one but did not get a proper response.

var urlParameterStringNew
=String.format(URLString,Alloy.Globals.SERVER_URL,"","","","","","","","","","","","","","","","");

推荐答案

第一次更改,我必须像这样创建我的 URL

First change , i have to create my URL like this

URLString = "%ssale-ws/lots/sales?yardNumber=%s&saleFromDate=%s&range=%s&saleToDate=%s&pageSize=%s&pageNo=%s&sortBy=%s&sortType=%s&filterStartYear=%s&filterEndYear=%s&filterMake=%s&filterModel=%s&filterLocationId=%s&filterLane=%s&filterSellerId=%s&searchInSearchString=%s",

然后我可以简单地用这样的任何其他值替换 %s 的值

Then i can simply to replace the value of %s with any other value like this

var finalRequestString = String.format(URLString),Alloy.Globals.SERVER_URL,"","","","","","","","","","","","","","","","");    

这篇关于如何创建一个在 Titanium 中传递不同值的请求字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆