Bob
Bob

Reputation: 569

Download JSON data from a web form

I am writing an app that asks for some data from a web-based form and then displays the returned JSON data. But I can't seem to get a handle on how "fill in" the form and get the data returned. The website developer has made a development form for testing this so I can see how it works. If I go to that website and enter data into the fields and press "Submit", it returns JSON-formatted text and displays it in the web browser's window.

What I need to do is have my app populate those fields with data and submit them to the server. The server returns the JSON data and I capture and process it in my app.

I would appreciate any advice on how to do this. As you may have guessed, I am a very new to iOS development. Thanks in advance.

Upvotes: 0

Views: 536

Answers (2)

Bio
Bio

Reputation: 505

Firstly, you'll need to know what form data you're going to send in a POST request. If you don't know where to find that, take a look at this.

Consider using AFNetworking to make that POST request with JSON feedback. Here's a good example.

Good luck!

Upvotes: 2

Joseph Yancey
Joseph Yancey

Reputation: 1498

This walkthrough by Matt Long is particularly good: http://www.cimgf.com/2010/02/12/accessing-the-cloud-from-cocoa-touch/.

Essentially, you just need your fields in the post data to match the fields that are present in the html form. Those fields should be evident by posting the form in chrome and watching the request in the network tab in developer tools.

Upvotes: 1

Related Questions