简体   繁体   English

yui aSync请求可以将对象作为参数发送吗?

[英]Can a yui aSync Request send objects as parameters?

有没有一种方法可以将javascript对象传递给yui aSync请求,或者它仅接受URI?

A YUI2 AsyncRequest sends a HTTP request to a URL using the request type you specify. YUI2 AsyncRequest使用您指定的请求类型将HTTP请求发送到URL。

You are free to append information as query parameters for a GET or POST, or to send it as POST data. 您可以随意将信息作为GET或POST的查询参数附加,也可以将其作为POST数据发送。

To do so you could write a simple for in loop to iterate over your object & create a query string that you can then either set as the POST data or append to your URL if sending a GET. 为此,您可以编写一个简单的for in循环来遍历对象并创建查询字符串,然后将其设置为POST数据,或者在发送GET时附加到URL上。 Be sure to use encodeURIComponent on the components as you are building your string. 在构建字符串时,请确保在组件上使用encodeURIComponent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM