开发者

Appcelerator Titanium XHR POST params as multi-level array

开发者 https://www.devze.com 2023-03-13 18:42 出处:网络
Ti.SDK 1.6.2 iOS 4.3 I have a web application that receives post data as multi-level arrays. Array ( [User] => Array
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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消