Building a Simple REST API for Mobile Applications

Originally published at: http://www.sitepoint.com/building-simple-rest-api-mobile-applications/

Representational State Transfer (REST) is lightweight, HTTP based and runs on web servers much like ‘normal’ web sites. Instead of delivering in HTML, which is a combination of presentation and data, data is displayed with minimum formatting using separators and delimiters (like JSON). It can be thought of as an architectural style for designing networked applications or as a way of delivering web services. REST is browsable, so helps developers modify and check the correctness of their code as only the data is displayed in the browser. It is a safer method of providing services or data access as it does not expose much unnecessary surface area of the database used by the website. Some well-known REST apis are from Twitter and Facebook Graph.

Continue reading this article on SitePoint

How you can differentiate which client makes the request? I.e. for js, you’ll have to validate captcha or for mobile you’ll have to send some push notifications and so on. Do you think http headers are a good approach?

Each iPhone/iPad can send a device token that contains an identifier of the device which can be used to identify a client. Which HTTP header field are you thinking of using? Authorization? I’ve seen most APIs use Basic Authorization and more secure ones using public/private key pair.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.