views:

1137

answers:

4

I am successfully using the json-framework to do GET HttpRequests. Does anyone have code to prepare a json object and do a POST HTTP Request? If so, can you please share some sample objective-c code. Thanks

+3  A: 

Take a look at this open source project hosted at google code.

Description:

This framework implements a strict JSON parser and generator in Objective-C.

Download the framework, embed it in your application, and import the JSON.h header. You're now ready to make your application speak JSON. The framework adds categories to existing Objective-C objects for a super-simple interface, and provides classes with more flexible APIs for added control.

zPesk
A: 

I'm already using the framework you mentioned. Do you have any sample example code to do this?

+1  A: 

Try TwitterHelper.m in Stanford's CS 193P "Presence3Files.zip" package.

I would post the code directly but am unsure if that is cool, license-wise.

Kevin L.
A: 

Thank you Kevin L. Is there a function or code you can share that builds the json object that is meant to be sent via POST? The UpdateStatus function just sends postData as an encoded string. Where does this code handle the {} and key:values for the JSON object to be posted? Do you have an example of code that builds that actual JSON object?

Zap