I want to pass an array to my server. I used the GET method, so I have to pass an argument after url. It looks like this:
http://www.myserver.com/?name=username&pwd=password
but now I have an array. It includes an NSDictionary. How can I append it to the url?
Here’s one suggestion I’ve used in the past:
If I’ve done this right, the output should be something like:
Strip off the first &, slap a URL and a “?” on the front and send it to your server. Your server will then have to pick this apart by testing with “isset” or similar to see when the numbers stop.
I’m assuming you have an arbitrary number of array elements but that each individual dictionary will have known fields–in other words, you’re passing an array of user dictionaries but each dictionary will have a “user” field and a “password” field. If this isn’t the case, you can still use this method, but you’ll have to do a little more work on both sides of the communication.