KEMBAR78
REST API Laravel | ODP
RESTfulAPI Basics
using Laravel 5+
/me
● John Dave Decano aka Dave
● Juwai Team
● Doing freelance since 2009
● No Formal Education on CS or IT
● Self Taught Programmer
● http://github.com/johndavedecano
● http://odesk.com/odeskfreelancer
● http://johndavedecano.me
What is restfulAPI?
● REST - Representational State Transfer
● REST is an architecture style for designing networked applications.
● In many ways, the World Wide Web itself, based on HTTP, can be viewed as a REST-
based architecture.
● RESTful API uses versioning. e.g POST /V1/todos/
● RESTful API explicitly take advantage of HTTP methodologies defined by the RFC 2616
protocol. They simply use "PUT" to change the state of or update a resource, which can be
an object, file or block; "GET" to retrieve a resource; POST" to create that resource; and
"DELETE" to remove it.
● Restful API uses HTTP Headers add information about the request and the response.
● Restful API uses HTTP Status Codes Correctly.
● Restful API is stateless.
● Restful API commonly use JSON or XML as a form of response.
● Each API request returns a subsequent API response.
What is restfulAPI?
● REST - Representational State Transfer
● REST is an architecture style for designing networked applications.
● In many ways, the World Wide Web itself, based on HTTP, can be
viewed as a REST-based architecture.
● RESTful API uses HTTP for all four CRUD
(Create/Read/Update/Delete) operations.
● Each request returns a subsequent response.
● HTTP Verbs – POST, GET, UPDATE, PUT, PATCH, DELETE
● HTTP Headers – Content-Type, Content-Length etc.
● Commonly used by Mobile Applications and Single Paged Apps.
● Commonly use JSON or XML as a form of response.
A stateless protocol does not require the server to retain information or
status about each user for the duration of multiple requests.
Requests are made up of a verb (POST, in this example), headers that describe the
message, and a body (Hello World, in this example).
The request is a message that describes what you want the server to accomplish.
Likewise, the response consists of three pieces: a status code (200), headers
describing the response and the body itself.
HTTP Verbs describe the type of operation:
GET: Retrieve a resource
POST: Create a resource
PUT: Update a resource
DELETE: Delete a resource
On the Web, the most common verb is GET. This is because the main purpose of a
Web page's function is to request different resources that make up a page. In REST-
based APIs, we leverage these verbs to describe the types of operations we want.
Hello Laravel
● Taylor Otwell
● Open Source
● Well Documented
● Active Community
● Lots of Jobs
● Easy Grasp
How about the security?
● REST api can be exposed to the public. They usually call it as Public APIs
● You can use OAUTH, HTTP Basic or JWT.
● OAuth is an open standard for authorization, commonly used as a way for Internet
users to log in to third party websites using their Google, Facebook, Microsoft,
Twitter, One Network, etc. accounts without exposing their password.
● HTTP Basic - In the context of an HTTP transaction basic access authentication is a
method for an HTTP user agent to provide a user name and password when making
a request.
● JSON Web Tokens are an open, industry standard RFC 7519 method for
representing claims securely between two parties.
TALK IS CHEAP
SHOW ME THE CODE
You will learn how to:
● Install LARAVEL
● Create URL Routes
● Create Migrations
● Create Seeder
● Create Models
● Create Controllers
● Create Requests Classes
● Create Validate Data
Questions?

REST API Laravel

  • 1.
  • 2.
    /me ● John DaveDecano aka Dave ● Juwai Team ● Doing freelance since 2009 ● No Formal Education on CS or IT ● Self Taught Programmer ● http://github.com/johndavedecano ● http://odesk.com/odeskfreelancer ● http://johndavedecano.me
  • 3.
    What is restfulAPI? ●REST - Representational State Transfer ● REST is an architecture style for designing networked applications. ● In many ways, the World Wide Web itself, based on HTTP, can be viewed as a REST- based architecture. ● RESTful API uses versioning. e.g POST /V1/todos/ ● RESTful API explicitly take advantage of HTTP methodologies defined by the RFC 2616 protocol. They simply use "PUT" to change the state of or update a resource, which can be an object, file or block; "GET" to retrieve a resource; POST" to create that resource; and "DELETE" to remove it. ● Restful API uses HTTP Headers add information about the request and the response. ● Restful API uses HTTP Status Codes Correctly. ● Restful API is stateless. ● Restful API commonly use JSON or XML as a form of response. ● Each API request returns a subsequent API response.
  • 4.
    What is restfulAPI? ●REST - Representational State Transfer ● REST is an architecture style for designing networked applications. ● In many ways, the World Wide Web itself, based on HTTP, can be viewed as a REST-based architecture. ● RESTful API uses HTTP for all four CRUD (Create/Read/Update/Delete) operations. ● Each request returns a subsequent response. ● HTTP Verbs – POST, GET, UPDATE, PUT, PATCH, DELETE ● HTTP Headers – Content-Type, Content-Length etc. ● Commonly used by Mobile Applications and Single Paged Apps. ● Commonly use JSON or XML as a form of response.
  • 5.
    A stateless protocoldoes not require the server to retain information or status about each user for the duration of multiple requests.
  • 6.
    Requests are madeup of a verb (POST, in this example), headers that describe the message, and a body (Hello World, in this example). The request is a message that describes what you want the server to accomplish. Likewise, the response consists of three pieces: a status code (200), headers describing the response and the body itself. HTTP Verbs describe the type of operation: GET: Retrieve a resource POST: Create a resource PUT: Update a resource DELETE: Delete a resource On the Web, the most common verb is GET. This is because the main purpose of a Web page's function is to request different resources that make up a page. In REST- based APIs, we leverage these verbs to describe the types of operations we want.
  • 7.
    Hello Laravel ● TaylorOtwell ● Open Source ● Well Documented ● Active Community ● Lots of Jobs ● Easy Grasp
  • 8.
    How about thesecurity? ● REST api can be exposed to the public. They usually call it as Public APIs ● You can use OAUTH, HTTP Basic or JWT. ● OAuth is an open standard for authorization, commonly used as a way for Internet users to log in to third party websites using their Google, Facebook, Microsoft, Twitter, One Network, etc. accounts without exposing their password. ● HTTP Basic - In the context of an HTTP transaction basic access authentication is a method for an HTTP user agent to provide a user name and password when making a request. ● JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
  • 9.
    TALK IS CHEAP SHOWME THE CODE
  • 10.
    You will learnhow to: ● Install LARAVEL ● Create URL Routes ● Create Migrations ● Create Seeder ● Create Models ● Create Controllers ● Create Requests Classes ● Create Validate Data
  • 11.