How to send JSON request to service with parameters in Objective-C

Posted by user1323884 on Stack Overflow See other posts from Stack Overflow or by user1323884
Published on 2012-04-10T11:23:19Z Indexed on 2012/04/10 11:28 UTC
Read the original article Hit count: 361

Filed under:

I'm creating a iPhone app, and im trying to figure out how to create a JSON request to the webservice that contains parameters. In Java this would look like this

HashMap<String, String> headers = new HashMap<String, String>();

JSONObject json = new JSONObject();

            json.put("nid", null);
            json.put("vocab", null);
            json.put("inturl", testoverview);
            json.put("mail", username); // [email protected]
            json.put("md5pw", password); // donkeykong

        headers.put("X-FBR-App", json.toString());

The header has to contain a JSON object and "X-FBR-App" before the service recognizes the request. How would this be implemented in Objective-C ?

© Stack Overflow or respective owner

Related posts about objective-c