SlideShare a Scribd company logo
1 of 15
ReST (Introduction)


 3rd Meetup PHP Indonesia

         6 April 2013
          Surabaya



       by Glend Maatita
ReST example (Twitter)
ReST example (Facebook)
ReST - History

●   Representational State Transfer


●   ReST was re-DISCOVER-ed by Roy Fielding


●   Doesnt require any external library


●   Tightly bond with HTTP
ReST – HTTP
Client Send Request           Server Send Response




GET / HTTP/1.1
Host: xkcd.com            HTTP/1.1 200 OK
Accept: text/html         Date: Sat, 02 Apr 2011 21:05:05 GMT
User-Agent: Mozilla/5.0   Server: lighttpd/1.4.19
(Macintosh)
                          Content-Type: text/html
                          <html>...</html>
ReST - HTTP
    HTTP Verb
●   GET
●   POST
●   PUT
●   DELETE


    Routes
●   URL + HTTP Verb
ReST - Definition


“The Same Thing with a different STATE
changes its meaning”


“The message is changed based on it's
State”
ReST – How To
●   Loved by developer
●   Easy to read, easy to
    understand, easy to learn
ReST
Bad !!                      Imagine :)


/getAllUsers                /getMentions
/getUserById                /getUserTimeLine
/getUsers                   /getHomeTimeLine
/deleteUser                 /getStatusesRetweet
/updateUser                 /updateStatuses
/deleteUserTenYearsOld      /destroyStatus
/newUser                    /getRetweets
/getUserUnderTenYearsOld
ReST - Quotes


“Web it's not about HTML pages, it's about resources,
    and those resources are located by URLs”
So ?
● We only need two base URLs as the location of a resource
(collection of resource, and single resource)
● Resources is Noun, use Noun :)

● Plural is better




    Resource    POST          GET (READ)       PUT            DELETE
                (CREATE)                       (UPDATE)


    /users      Create new    List all Users   Update All     Delete All
                user                           Users          Users


    /users/1    -             Show User        Update User Delete User
                              (with ID = 1)    with ID = 1 (if with ID = 1
                                               Exist)
Association ?
Easy :)


GET /departments/1/users
POST /departments/1/users
PUT /users/123
DELETE /users/123
Query
Use '?' for Query


GET /users?limit=50&offset=100
GET /users?username=indra&birth=1990
GET /users?column=id,name,username,birth
GET /users.json (/users.xml)
Versioning
/v1/users/
Terima Kasih




                Glend Maatita
                  @glend_maatita
                  YM : the_entung
      glend.maatita@kampus.co.id

More Related Content

Viewers also liked

How To Make Your Day Last Longer: Time Management in Marketing Projects
How To Make Your Day Last Longer: Time Management in Marketing Projects How To Make Your Day Last Longer: Time Management in Marketing Projects
How To Make Your Day Last Longer: Time Management in Marketing Projects Alek Kowalczyk
 
Understanding the state of your web application using Apache Kafka, Spark
Understanding the state of your web application using Apache Kafka, SparkUnderstanding the state of your web application using Apache Kafka, Spark
Understanding the state of your web application using Apache Kafka, SparkExist
 
NEW WORLD COMING
NEW WORLD COMINGNEW WORLD COMING
NEW WORLD COMINGjpscheller
 
iprocurment Buyer Guide
iprocurment Buyer Guideiprocurment Buyer Guide
iprocurment Buyer GuideRazzy Jey
 
Navegadores web
Navegadores webNavegadores web
Navegadores webhanson
 
Philippine Java Industry
Philippine Java IndustryPhilippine Java Industry
Philippine Java IndustryExist
 
Rails 3
Rails 3Rails 3
Rails 3Exist
 
2010 NYC Presentation
2010 NYC Presentation2010 NYC Presentation
2010 NYC Presentationbfum316
 
N efemed gs1 standaard kosten of kansen
N efemed gs1 standaard kosten of kansenN efemed gs1 standaard kosten of kansen
N efemed gs1 standaard kosten of kansenGS1 Nederland
 
Node.js Presentation
Node.js PresentationNode.js Presentation
Node.js PresentationExist
 
How to survive and thrive in the era of free shipping
How to survive and thrive in the era of free shippingHow to survive and thrive in the era of free shipping
How to survive and thrive in the era of free shippingGoECart
 
СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...
СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...
СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...Елена Денисова
 

Viewers also liked (20)

How To Make Your Day Last Longer: Time Management in Marketing Projects
How To Make Your Day Last Longer: Time Management in Marketing Projects How To Make Your Day Last Longer: Time Management in Marketing Projects
How To Make Your Day Last Longer: Time Management in Marketing Projects
 
Pharmacognosy 5th sem
Pharmacognosy 5th semPharmacognosy 5th sem
Pharmacognosy 5th sem
 
Understanding the state of your web application using Apache Kafka, Spark
Understanding the state of your web application using Apache Kafka, SparkUnderstanding the state of your web application using Apache Kafka, Spark
Understanding the state of your web application using Apache Kafka, Spark
 
NEW WORLD COMING
NEW WORLD COMINGNEW WORLD COMING
NEW WORLD COMING
 
Paycreditreport
PaycreditreportPaycreditreport
Paycreditreport
 
iprocurment Buyer Guide
iprocurment Buyer Guideiprocurment Buyer Guide
iprocurment Buyer Guide
 
Generation 3
Generation 3Generation 3
Generation 3
 
Kidnapped nt
Kidnapped ntKidnapped nt
Kidnapped nt
 
Navegadores web
Navegadores webNavegadores web
Navegadores web
 
Philippine Java Industry
Philippine Java IndustryPhilippine Java Industry
Philippine Java Industry
 
Immigration
ImmigrationImmigration
Immigration
 
Pharmacognosy 5th sem
Pharmacognosy 5th semPharmacognosy 5th sem
Pharmacognosy 5th sem
 
Exploring membership 3
Exploring membership 3Exploring membership 3
Exploring membership 3
 
Rails 3
Rails 3Rails 3
Rails 3
 
2010 NYC Presentation
2010 NYC Presentation2010 NYC Presentation
2010 NYC Presentation
 
N efemed gs1 standaard kosten of kansen
N efemed gs1 standaard kosten of kansenN efemed gs1 standaard kosten of kansen
N efemed gs1 standaard kosten of kansen
 
Node.js Presentation
Node.js PresentationNode.js Presentation
Node.js Presentation
 
How to survive and thrive in the era of free shipping
How to survive and thrive in the era of free shippingHow to survive and thrive in the era of free shipping
How to survive and thrive in the era of free shipping
 
2011 (5) mar
2011 (5) mar2011 (5) mar
2011 (5) mar
 
СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...
СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...
СЕТЕВЫЕ ПРОЕКТЫ КАК СРЕДСТВА ФОРМИРОВАНИЯ ИНФОРМАЦИОННОЙ КОМПЕТЕНТНОСТИ ОБУЧА...
 

Similar to PHP Indonesia 3rd meetup - 06/04/13

RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座Li Yi
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web ServiceHoan Vu Tran
 
Restful webservices
Restful webservicesRestful webservices
Restful webservicesKong King
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
rest-api-basics.pptx
rest-api-basics.pptxrest-api-basics.pptx
rest-api-basics.pptxFikiRieza2
 
Getting started with DSpace 7 REST API
Getting started with DSpace 7 REST APIGetting started with DSpace 7 REST API
Getting started with DSpace 7 REST API4Science
 
Data persistence using pouchdb and couchdb
Data persistence using pouchdb and couchdbData persistence using pouchdb and couchdb
Data persistence using pouchdb and couchdbDimgba Kalu
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web ServicesBradley Holt
 
04 request-headers
04 request-headers04 request-headers
04 request-headerssnopteck
 
RESTful web service with JBoss Fuse
RESTful web service with JBoss FuseRESTful web service with JBoss Fuse
RESTful web service with JBoss Fuseejlp12
 
RESTful for opentravel.org by HP
RESTful for opentravel.org by HPRESTful for opentravel.org by HP
RESTful for opentravel.org by HPRoni Schuetz
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 SlidesSuraj Gupta
 
nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicehazzaz
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding RESTNitin Pande
 

Similar to PHP Indonesia 3rd meetup - 06/04/13 (20)

REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
Rest And Rails
Rest And RailsRest And Rails
Rest And Rails
 
L18 REST API Design
L18 REST API DesignL18 REST API Design
L18 REST API Design
 
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
 
Day02 a pi.
Day02   a pi.Day02   a pi.
Day02 a pi.
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
rest-api-basics.pptx
rest-api-basics.pptxrest-api-basics.pptx
rest-api-basics.pptx
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
 
Getting started with DSpace 7 REST API
Getting started with DSpace 7 REST APIGetting started with DSpace 7 REST API
Getting started with DSpace 7 REST API
 
Data persistence using pouchdb and couchdb
Data persistence using pouchdb and couchdbData persistence using pouchdb and couchdb
Data persistence using pouchdb and couchdb
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web Services
 
04 request-headers
04 request-headers04 request-headers
04 request-headers
 
RESTful web service with JBoss Fuse
RESTful web service with JBoss FuseRESTful web service with JBoss Fuse
RESTful web service with JBoss Fuse
 
RESTful for opentravel.org by HP
RESTful for opentravel.org by HPRESTful for opentravel.org by HP
RESTful for opentravel.org by HP
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-service
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 

Recently uploaded

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

PHP Indonesia 3rd meetup - 06/04/13

  • 1. ReST (Introduction) 3rd Meetup PHP Indonesia 6 April 2013 Surabaya by Glend Maatita
  • 4. ReST - History ● Representational State Transfer ● ReST was re-DISCOVER-ed by Roy Fielding ● Doesnt require any external library ● Tightly bond with HTTP
  • 5. ReST – HTTP Client Send Request Server Send Response GET / HTTP/1.1 Host: xkcd.com HTTP/1.1 200 OK Accept: text/html Date: Sat, 02 Apr 2011 21:05:05 GMT User-Agent: Mozilla/5.0 Server: lighttpd/1.4.19 (Macintosh) Content-Type: text/html <html>...</html>
  • 6. ReST - HTTP HTTP Verb ● GET ● POST ● PUT ● DELETE Routes ● URL + HTTP Verb
  • 7. ReST - Definition “The Same Thing with a different STATE changes its meaning” “The message is changed based on it's State”
  • 8. ReST – How To ● Loved by developer ● Easy to read, easy to understand, easy to learn
  • 9. ReST Bad !! Imagine :) /getAllUsers /getMentions /getUserById /getUserTimeLine /getUsers /getHomeTimeLine /deleteUser /getStatusesRetweet /updateUser /updateStatuses /deleteUserTenYearsOld /destroyStatus /newUser /getRetweets /getUserUnderTenYearsOld
  • 10. ReST - Quotes “Web it's not about HTML pages, it's about resources, and those resources are located by URLs”
  • 11. So ? ● We only need two base URLs as the location of a resource (collection of resource, and single resource) ● Resources is Noun, use Noun :) ● Plural is better Resource POST GET (READ) PUT DELETE (CREATE) (UPDATE) /users Create new List all Users Update All Delete All user Users Users /users/1 - Show User Update User Delete User (with ID = 1) with ID = 1 (if with ID = 1 Exist)
  • 12. Association ? Easy :) GET /departments/1/users POST /departments/1/users PUT /users/123 DELETE /users/123
  • 13. Query Use '?' for Query GET /users?limit=50&offset=100 GET /users?username=indra&birth=1990 GET /users?column=id,name,username,birth GET /users.json (/users.xml)
  • 15. Terima Kasih Glend Maatita @glend_maatita YM : the_entung glend.maatita@kampus.co.id