Appcelerator Titanium XHR POST 参数作为多级数组
Ti.SDK 1.6.2
iOS 4.3
我有一个 Web 应用程序,它接收多级数组形式的发布数据。
Array
(
[User] => Array
(
[name] => Josey Morton
[username] => jmorton
[password] => ########
)
[Product] => Array
(
[name] => Pro Drupal Development
[type] => Book
[price] => 49.99
)
)
然后,我的服务器端应用程序获取“用户”和“产品”的内容并以不同的方式解析它们,并将它们存储在各自的数据库中。
我的问题:
如何将此格式作为 HTTPClient 发送参数传递,这样服务器端就不需要调整?
Ti.SDK 1.6.2
iOS 4.3
I have a web application that receives post data as multi-level arrays.
Array
(
[User] => Array
(
[name] => Josey Morton
[username] => jmorton
[password] => ########
)
[Product] => Array
(
[name] => Pro Drupal Development
[type] => Book
[price] => 49.99
)
)
My serverside app then takes the contents of "User" and "Product" and parses them differently, storing them in their respective databases.
My question:
How can I pass this format as the HTTPClient send params so no adjustment is needed on the server side?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终将其作为 JSON 序列化字符串传递并在 JSON 服务器端进行解码。这允许我需要的分层后数组。
I ended up passing it as a JSON serialized string and decoded the JSON server side. This allowed for the hierarchical post array I required.