更新时间:2023-02-23 21:31:35
虽然POST可以为同一个键有多个值,我会谨慎使用它,因为有些服务器甚至不能正确处理,这是也许这是为什么不支持?如果您将重复的参数列表,整个事情可能会开始呛,如果一个参数来仅一次,suddendly你风有一个字符串或东西...但我想你知道自己在做什么......
Although POST may be having multiple values for the same key, I'd be cautious using it, since some servers can't even properly handle that, which is probably why this isn't supported ... if you convert "duplicate" parameters to a list, the whole thing might start to choke, if a parameter comes in only once, and suddendly you wind up having a string or something ... but i guess you know what you're doing ...
我很抱歉这样说,但你想要做的,是不可能在纯粹的AS2 ...唯一的2类适用于HTTP是 Load忱
和 XML
...技术上也的loadVariables
,但它只是复制传递的对象属性进请求,这没有按'T改变你的问题,因为属性是唯一...
I am sorry to say so, but what you want to do, is not possible in pure AS2 ... the only 2 classes available for HTTP are LoadVars
and XML
... technically there's also loadVariables
, but it will simply copy properties from the passed object into the request, which doesn't change your problem, since properties are unique ...
如果你想坚持到AS2,你需要一个中间层:
if you want to stick to AS2, you need an intermediary tier:
flash.external :: ExternalInterface的
,你可以调用JavaScript code。您需要定义一个回调,当操作完成的,还有,你可以调用(还有其他的方式,但是这应该足够了)JavaScript函数。建立内部闪存的请求字符串,用泵为JavaScript和让的JavaScript它在一个POST请求发送到服务器,并获得响应回Flash通过回调。flash.external::ExternalInterface
you can call JavaScript code. You need to define a callback for when the operation is done, as well as a JavaScript function that you can call (there are other ways but this should suffice). Build the request string inside flash, pump it to JavaScript and let JavaScript send it to the server in a POST request and get the response back to flash through the callback.由你来决定哪一个是更多的工作...
up to you to decide which one is more work ...
侧面说明:的在AS3中,你会使用 flash.net::URLLoader
与 DATAFORMAT
设置为 flash.net::URLLoaderDataFormat.TEXT
,然后重新连接code参数为一个字符串,并把他们。
side note: in AS3, you'd use flash.net::URLLoader
with dataFormat
set to flash.net::URLLoaderDataFormat.TEXT
, and then again encode parameters to a string, and send them.