SlideShare a Scribd company logo
1 of 12
Restful webservices design
Ahmed Elbassel
Email: elbassel.n13@gmail.com
Skype: ahmed_elbassel
Restful Webservices
- History
- What is webservices?
- Resource-Oriented Architecture
- HTTP methods
- Restful API design
- References
History
- Before 1999, people used to use SOAP to
integrate APIs.
- In 2000, REST was defined by Roy
Fielding in his PhD dissertation
"Architectural Styles and the Design of
Network-based Software Architectures"
History
- Properties:
- Scalability: to support large numbers of components and interactions among components.
- Simplicity of a Uniform Interface
- Modifiability of components to meet changing needs (even while the application is running)
- Portability of components by moving program code with the data
- Constraints:
- Client-Server
- Stateless: Each request from any client contains all the information necessary to service the
request
- Cacheable: Responses must, implicitly or explicitly, define themselves as cacheable, or not, to
avoid unsuitable response.
- Layered System: A client cannot ordinarily tell whether it is connected directly to the end
server, or to an intermediary along the way.
What is Restful Webservices?
- Representational state transfer (REST) or RESTful Web services are one way
of providing interoperability between computer systems on the Internet.
- Fielding used REST to design HTTP 1.1
Resource-Oriented Architecture
- In software engineering, a resource-oriented architecture (ROA) is a style of
software architecture and programming paradigm for designing and
developing software in the form of resources with "RESTful" interfaces.
HTTP methods
- HTTP implements REST, and we’re using HTTP to provide our restful
webservices.
HTTP Method Operation Note
POST Create It creates a new instance, it returns 201 code
PUT Update/Replace It updates or replaces the entire instance, it returns 200.
GET Read It reads from the server, it returns http code 200
PATCH Update/Modify It updates specific thing inside the instance, it returns 200
DELETE Remove It removes an instance, it returns 200
Restful API design
- It’s all about resources, REST tries to make every resource is a unique
location.
- URI: is used to locate the resource.
- To get tulip1 image in hard drive: /images/tulip1.jpg
Restful API design
Suppose we have the following Object:
User
Name: String
SSN: String
Job: String
addresses:
Address
Street: String
Building: String
Apartment: String
Restful API design - Moving from Verbs to Nouns
- Old API: getUser.
- Verb (get) + resource name(User)
- Old API: createUser.
- Verb(create) + resource name(User)
- Old API: deleteUser.
- Verb(delete) + resource name(User)
- Old API: updateUser.
- Verb(update) + resource name(user)
- HTTP provides the method name, your turn to provide the resource name:
- GET: /User/userId
- POST: /User
- DELETE: /User/userId
- PUT: /User/userId
Restful API design - More
- Old API: getUserAddress.
- Verb (get) + resource name(UserAddress)
- Old API: createUserAddress.
- Verb(create) + resource name(UserAddress)
- Old API: deleteUserAddress.
- Verb(delete) + resource name(UserAddress)
- Old API: updateUserAddress.
- Verb(update) + resource name(userAccont)
- HTTP provides the method name, your turn to provide the resource name:
- GET: /User/userId/addresses
- POST: /user/userId/addresses
- DELETE: /user/userId/adresses/id
- PUT: /User/userId/adresses
References
https://msdn.microsoft.com/en-us/library/dd203052.aspx
https://en.wikipedia.org/wiki/Resource-oriented_architecture
https://en.wikipedia.org/wiki/Representational_state_transfer

More Related Content

What's hot

Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esbRaviShankar Mishra
 
Using message enricher
Using message enricherUsing message enricher
Using message enricherSon Nguyen
 
Mule with drools
Mule with droolsMule with drools
Mule with droolsF K
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in muleKhasim Cise
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in MuleF K
 
SOAP To REST API Proxy
SOAP To REST API ProxySOAP To REST API Proxy
SOAP To REST API ProxyVince Soliza
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web servicesShanky Gupta
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-boundSon Nguyen
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in muleRajkattamuri
 
Mule esb add logger to existing flow
Mule esb add logger to existing flowMule esb add logger to existing flow
Mule esb add logger to existing flowGermano Barba
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applicationskumar gaurav
 

What's hot (19)

Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esb
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Quartz in Mule
Quartz in MuleQuartz in Mule
Quartz in Mule
 
Mule batch job
Mule batch jobMule batch job
Mule batch job
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
 
SOAP To REST API Proxy
SOAP To REST API ProxySOAP To REST API Proxy
SOAP To REST API Proxy
 
Rack
RackRack
Rack
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
 
Initialize database in Mule part2
Initialize database in Mule part2Initialize database in Mule part2
Initialize database in Mule part2
 
Timer Interceptor in Mule
Timer Interceptor in MuleTimer Interceptor in Mule
Timer Interceptor in Mule
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 
Mule - logger
Mule -  loggerMule -  logger
Mule - logger
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
 
Mule esb add logger to existing flow
Mule esb add logger to existing flowMule esb add logger to existing flow
Mule esb add logger to existing flow
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applications
 

Similar to 07 restful webservices design

Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyManageIQ
 
KaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKate_RESTful
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIFilip W
 
Api design and development
Api design and developmentApi design and development
Api design and developmentoquidave
 
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.TechnocratAu
 
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSouth Tyrol Free Software Conference
 
WSO2 ESB Integration with REST
WSO2 ESB Integration with RESTWSO2 ESB Integration with REST
WSO2 ESB Integration with RESTWSO2
 
RESTful API-centric Universe
RESTful API-centric UniverseRESTful API-centric Universe
RESTful API-centric UniverseTihomir Opačić
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you pownedDinis Cruz
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDBMongoDB
 
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and PythonDEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and PythonCisco DevNet
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIsGiuseppe Marchi
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platformNelson Kopliku
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?Aparna Sharma
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 

Similar to 07 restful webservices design (20)

Http and REST APIs.
Http and REST APIs.Http and REST APIs.
Http and REST APIs.
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 
KaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: Introduction
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web API
 
Api design and development
Api design and developmentApi design and development
Api design and development
 
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
 
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
 
WSO2 ESB Integration with REST
WSO2 ESB Integration with RESTWSO2 ESB Integration with REST
WSO2 ESB Integration with REST
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
RESTful API-centric Universe
RESTful API-centric UniverseRESTful API-centric Universe
RESTful API-centric Universe
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
 
REST full API Design
REST full API DesignREST full API Design
REST full API Design
 
Web api
Web apiWeb api
Web api
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
 
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and PythonDEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIs
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 

More from Ahmed Elbassel

More from Ahmed Elbassel (10)

13 mongoose
13 mongoose13 mongoose
13 mongoose
 
12 mongo db_and_nodejs
12 mongo db_and_nodejs12 mongo db_and_nodejs
12 mongo db_and_nodejs
 
11 schema design & crud
11 schema design & crud11 schema design & crud
11 schema design & crud
 
10 mongo db
10 mongo db10 mongo db
10 mongo db
 
06 start node coding
06 start node coding06 start node coding
06 start node coding
 
04_Node modules
04_Node modules04_Node modules
04_Node modules
 
03 json for java script
03 json for java script03 json for java script
03 json for java script
 
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
 
Airbnb Java Script style guide
Airbnb Java Script style guideAirbnb Java Script style guide
Airbnb Java Script style guide
 
Story of java
Story of javaStory of java
Story of java
 

Recently uploaded

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 

Recently uploaded (20)

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 

07 restful webservices design

  • 1. Restful webservices design Ahmed Elbassel Email: elbassel.n13@gmail.com Skype: ahmed_elbassel
  • 2. Restful Webservices - History - What is webservices? - Resource-Oriented Architecture - HTTP methods - Restful API design - References
  • 3. History - Before 1999, people used to use SOAP to integrate APIs. - In 2000, REST was defined by Roy Fielding in his PhD dissertation "Architectural Styles and the Design of Network-based Software Architectures"
  • 4. History - Properties: - Scalability: to support large numbers of components and interactions among components. - Simplicity of a Uniform Interface - Modifiability of components to meet changing needs (even while the application is running) - Portability of components by moving program code with the data - Constraints: - Client-Server - Stateless: Each request from any client contains all the information necessary to service the request - Cacheable: Responses must, implicitly or explicitly, define themselves as cacheable, or not, to avoid unsuitable response. - Layered System: A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way.
  • 5. What is Restful Webservices? - Representational state transfer (REST) or RESTful Web services are one way of providing interoperability between computer systems on the Internet. - Fielding used REST to design HTTP 1.1
  • 6. Resource-Oriented Architecture - In software engineering, a resource-oriented architecture (ROA) is a style of software architecture and programming paradigm for designing and developing software in the form of resources with "RESTful" interfaces.
  • 7. HTTP methods - HTTP implements REST, and we’re using HTTP to provide our restful webservices. HTTP Method Operation Note POST Create It creates a new instance, it returns 201 code PUT Update/Replace It updates or replaces the entire instance, it returns 200. GET Read It reads from the server, it returns http code 200 PATCH Update/Modify It updates specific thing inside the instance, it returns 200 DELETE Remove It removes an instance, it returns 200
  • 8. Restful API design - It’s all about resources, REST tries to make every resource is a unique location. - URI: is used to locate the resource. - To get tulip1 image in hard drive: /images/tulip1.jpg
  • 9. Restful API design Suppose we have the following Object: User Name: String SSN: String Job: String addresses: Address Street: String Building: String Apartment: String
  • 10. Restful API design - Moving from Verbs to Nouns - Old API: getUser. - Verb (get) + resource name(User) - Old API: createUser. - Verb(create) + resource name(User) - Old API: deleteUser. - Verb(delete) + resource name(User) - Old API: updateUser. - Verb(update) + resource name(user) - HTTP provides the method name, your turn to provide the resource name: - GET: /User/userId - POST: /User - DELETE: /User/userId - PUT: /User/userId
  • 11. Restful API design - More - Old API: getUserAddress. - Verb (get) + resource name(UserAddress) - Old API: createUserAddress. - Verb(create) + resource name(UserAddress) - Old API: deleteUserAddress. - Verb(delete) + resource name(UserAddress) - Old API: updateUserAddress. - Verb(update) + resource name(userAccont) - HTTP provides the method name, your turn to provide the resource name: - GET: /User/userId/addresses - POST: /user/userId/addresses - DELETE: /user/userId/adresses/id - PUT: /User/userId/adresses