From the course: iOS App Development: RESTful Web Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

RESTful fetching one item

RESTful fetching one item - iOS Tutorial

From the course: iOS App Development: RESTful Web Services

Start my 1-month free trial

RESTful fetching one item

- [Instructor] As I've mentioned previously, it's a common convention to be able to fetch a single item from the server using the id of that item as it's stored in the database. We're going to look at doing that now using a RESTful API and fetch a single item. So, we're going to use the URL as we constructed it before using a string, but now we're going to add an item id to it. We're also still going to use the URLSession data task and the closure very similarly to the way we did before. However, now in our closure, the data that's returned to us will be JSON. So, we're going to go back to our project in Xcode. However, now we're going to use a different URL. Now we're going to use a URL that we know has a RESTful API. We're going to use the Orange Valley Community Art Association website. It's orangevalleycaa.org. This is where our API resides, and we know from the developer that it resides at /api. Normally you would get that information from any documentation where the developers…

Contents