News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Best Practices REST API from Scratch - Introduction
July 22, 2014 @ 09:39:12

The SitePoint PHP blog has posted the second part of their series looking at building up a REST API "from scratch". In this latest post Vita Tardia introduces some of the basic topics and the best practices that are around their use.

The current internet ecosystem has literally been invaded by APIs, and for good reasons. By using third party APIs in your products or services, you have access to a ton of useful features - such as authentication or storage services - that can benefit both you and your users. By exposing your own API, your application becomes "part of the mix" and will be used in ways you've never thought before… if you do it the right way, obviously. In this two part series I'll show you how to create a RESTful API layer for your PHP applications, using a collection of real world best practices.

He talks about how a REST API is a "user interface for developers" and the actions the different verbs could take on the same endpoints (PUT, POST, GET, etc). He uses the Slim framework in his examples and helps you get an instance all set up and working. He includes a bit about getting SSL/HTTPS up and running for all requests to the site too. From there he gets into the bootstrapping of the application and the first version of controller handling. He also includes code examples touching on JSON handling, authentication and good error handling.

0 comments voice your opinion now!
tutorial rest api introduction slimframework bestpractices

Link: http://www.sitepoint.com/best-practices-rest-api-scratch-introduction/

blog comments powered by Disqus

Similar Posts

ZendCasts.com: Logging in Users using Doctrine and Zend_Auth

Dagfinn Reiersol's Blog: Real programming with PHP 5.3 (part 4): A more realistic example

TechPortal: Custom Zend Framework Form Elements

Zurab Davitiani: PHP Sessions in Erlang Mnesia

DeveloperTutorials.com: Upload Files to MySQL using PHP Tutorial


Community Events





Don't see your event here?
Let us know!


bugfix release zendserver deployment library list conference symfony language introduction api series community developer laravel tips framework podcast interview voicesoftheelephpant

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework