在HTTPService中按顺序发送参数 [英] Send parameters in order in HTTPService

查看:125
本文介绍了在HTTPService中按顺序发送参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用简单的HTTPService.问题是我的Web服务意识到它获取参数的顺序.我用一个例子来说明这个问题:

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); 

请注意,在上面的代码中,我在方面之前提到了参数,但是我收到的网址是facet=true&rows=0.因此,我在构面之前收到了参数行,因此我的Web服务无法正常工作.我发现数组的内容总是按字母顺序发送,这是我不希望的.

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?

请注意,我无权更改Web服务的逻辑(它基本上是支持桌面和Web客户端的RPC服务).

Note that I am not in power of changing the logic of webservice(its basically a RPC service supporting both desktop and web client).

谢谢.

推荐答案

我假设您正在使用get方法.而不是将参数传递给HTTPService,而是构建一个url字符串.您只需更改字符串然后调用服务即可传递get参数.

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.

service.url = "originalURL" + "?" + "rows=0" + "&" + "facet=true";
service.send();

这篇关于在HTTPService中按顺序发送参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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