JSON GET and POST

跟風遠走 提交于 2019-12-08 12:31:13

问题


I am learning iOS app development. I have JSON data coming from one of the sites in the form of Dictionary within an Array and within that Dictionary I have another Array and that contains another Dictionary. for ex ,

Now I want to deserialize it and use it in my iOS app and also I have to post some data like a comment back to the server.The comment by teacher will be a POST to the server.

I hope the question makes sense.

I am stuck on how to deserialize this and use POST to server.

Any help is appreciated. Thanks in advance.


回答1:


There are a couple of parts to your question:

1) To get the JSON data into a format which can easily be manipulated by your program, it's easiest to take an existing open-source JSON parser library and integrate it into your app. I like SBJSON. If you go to that site, it has instructions on including and using the library in your project.

2) To post a reply to the server, you need to know what format it expects the data in. Is your app interacting with an existing website (where a user could go to a page and fill out a form), or is it talking to an API?



来源:https://stackoverflow.com/questions/20715367/json-get-and-post

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!