RESTful Web Architecture
Upcoming SlideShare
Loading in...5
×
 

RESTful Web Architecture

on

  • 245 views

Talk at PHP Developers Meet #12

Talk at PHP Developers Meet #12
2014-08-23

Statistics

Views

Total Views
245
Views on SlideShare
243
Embed Views
2

Actions

Likes
1
Downloads
7
Comments
1

1 Embed 2

http://www.slideee.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

RESTful Web Architecture RESTful Web Architecture Presentation Transcript

  • RESTful Web Architecture Shritesh Bhattarai @shritesh
  • The Situation • Websites have become apps. • Multitude of platforms to develop for. • Excessively data driven. • Lots of external service integrations.
  • The Problem • Different systems for the ‘website’ and the ‘app’. • Reinventing the wheel, over and over. • Lack of well-thought architecture. • HTTP over HTTP.
  • Hypertext Transfer Protocol Client Server GET /index.html HTTP/1.1 Host: www.example.com HTTP/1.1 200 OK Date: Mon, 23 May 2005 22:38:34 GMT Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux) Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT ETag: "3f80f-1b6-3e1cb03b" Content-Type: text/html; charset=UTF-8 Content-Length: 131 Accept-Ranges: bytes Connection: close ! <html> <head> <title>An Example Page</title> </head> <body> Hello World, this is a very simple HTML document. </body> </html>
  • HTTP • Method: GET / HEAD / POST / PUT / DELTE / … • Path: Address to a resource (identifier) • Header: Host: example.com, … • Status code: 200 OK, 404 Not found • Body: Hello World
  • The Example App A todo app (Hello world for web programming)
  • The Resource • ToDo List Item • Contents: • id • title • done • created_at • updated_at
  • The Interface • Methods map to their HTTP headers • Create: POST • Read: GET • Update: PUT / PATCH • Delete: DELETE
  • The Interface • The URIs point to specific resource • /todo : Collection of todos • /todo/id : a specific todo
  • The Representation of the Resource
  • The Statelessness • Every request is self contained • Information is stored on the header
  • REST REpresentational State Transfer • Uniform Interface • Stateless • Cacheable • Client-Server • Layered System • Code-on-demand (optional)
  • Why REST? • A time tested architecture. • Both machine and human friendly. • Made for the web.
  • Thank you