Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Micahyah Hawkins
Micahyah Hawkins
3,496 Points

Where can I find tutorial on creating JSON result form a query

Hello,

I am back with teamtreehouse :) I am going through the creating a blog reader and making customizations. But I am now needing to create a JSON result page on my website. I need to query my MS SQL Server and with the results create my JSON result page to use in my app. I am having a horrible time trying to find a tutorial that could walk me through this.

If anyone knows of a tutorial somewhere it would be greatly appreciated.

1 Answer

Patrick Cooney
Patrick Cooney
12,216 Points

You'll need to write some code in whatever language or framework you are comfortable with to return JSON. Rails has some built in functionality to automatically render out a JSON response for you. PHP also has ways of rendering out JSON. You then just have to set up a URL end point where the JSON can be reached via a web request. Connect to that URL from within your app.