简体   繁体   中英

Webservice connecting do database with IOS, PHP, REST API, JSON

i have tried to understand how to connect to a database with an IOS application. i built an application that connects to a database on my localhost. i wrote a web service in PHP that returns a JSON encoded response, i then wrote the rest of the code in obj C with NSURL etc. that is app-->web service-->database, right?

but im trying to understand things i read on the internet, like someone mentioning using the REST API, i dont understand what to use REST for, and what REST is really (noob i know). i understand that REST gives JSON encoded responses, but is it something you use to create a web service ?

so is their someone who can explain to me what REST, web services in PHP, JAVA and JSON etc is in relation to mobile development ? please provide examples, thats the way i understand best.

Let me tell you, for a newbie you are on the right path and have the done it right! Once you get a hang of the basic json request / response webservices, you will yearn for more. Like security, uniform interface etc.

REST is nothing different from what you did. REST is an acronym for REpresentational State Transfer. The key part is statelessness.

REST uses HTTP verbs POST,GET, PUT/PATCH & DELETE to do the basic CRUD (Create, Read, Update and Delete).

Two additional verbs are OPTIONS (to retrieve the list of actions that can be performed) and HEAD (to return headers)

Read this to get a fair idea: http://restcookbook.com/

http://www.drdobbs.com/web-development/restful-web-services-a-tutorial/240169069

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM