在HTTPService中按顺序发送参数
我正在尝试使用简单的 HTTPService。问题是我的网络服务知道它得到的参数的顺序。我用一个例子来说明这个问题:
var service:HTTPService = new HTTPService();
var params:Object = new Object();
params.rows = 0;
params.facet = "true";
service.send(params);
注意,在上面的代码中,我在facet之前提到了参数rows,但是我收到的url是facet=true& ;行=0
。所以我在facet之前收到参数行,因此我的网络服务不起作用。我发现数组的内容总是按字母顺序发送,这是我不想要的。
有什么方法可以实现发送参数的显式排序吗?
请注意,我无权更改 Web 服务的逻辑(它基本上是支持桌面和 Web 客户端的 RPC 服务)。
谢谢。
I am trying to work with a simple HTTPService. The problem is that my webservice is conscious of the order of arguments it gets. I will tell the problem with an example:
var service:HTTPService = new HTTPService();
var params:Object = new Object();
params.rows = 0;
params.facet = "true";
service.send(params);
Note that in the above code I have mentioned the parameter rows before facet, but the url I recieve is facet=true&rows=0
. So I recieve the argument rows before facet and hence my webservice does not work. I figured out that the contents of array is always sent in alphabetical order, which I dont want.
Is there any way I can achieve explict ordering of parameters sent?
Note that I am not in power of changing the logic of webservice(its basically a RPC service supporting both desktop and web client).
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在使用 get 方法。不要将参数传递给 HTTPService,而是构建一个 url 字符串。您只需更改该字符串然后调用服务即可传递获取参数。
I am assuming you are using a get method. Instead of passing params to the HTTPService, build a url string. You can pass get params just by changing that string then calling the service.