SlideShare a Scribd company logo
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 esb
RaviShankar Mishra
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
Son Nguyen
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
F K
 
Quartz in Mule
Quartz in MuleQuartz in Mule
Quartz in Mule
Mohammed246
 
Mule batch job
Mule batch jobMule batch job
Mule batch job
Anirban Sen Chowdhary
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
Khasim Cise
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
F K
 
SOAP To REST API Proxy
SOAP To REST API ProxySOAP To REST API Proxy
SOAP To REST API Proxy
Vince Soliza
 
Rack
RackRack
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
Anirban Sen Chowdhary
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
Shanky 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-bound
Son Nguyen
 
Initialize database in Mule part2
Initialize database in Mule part2Initialize database in Mule part2
Initialize database in Mule part2
Anirban Sen Chowdhary
 
Timer Interceptor in Mule
Timer Interceptor in MuleTimer Interceptor in Mule
Timer Interceptor in Mule
Anirban Sen Chowdhary
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
Praneethchampion
 
Mule - logger
Mule -  loggerMule -  logger
Mule - logger
Ankush Sharma
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
Rajkattamuri
 
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
Germano Barba
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applications
kumar 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

Http and REST APIs.
Http and REST APIs.Http and REST APIs.
Http and REST APIs.
Rahul Tanwani
 
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
ManageIQ
 
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
Kate_RESTful
 
RESTful_Web_Services_Presentation (1).pptx
RESTful_Web_Services_Presentation (1).pptxRESTful_Web_Services_Presentation (1).pptx
RESTful_Web_Services_Presentation (1).pptx
onlinesewatest
 
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
Filip W
 
Api design and development
Api design and developmentApi design and development
Api design and development
oquidave
 
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 framework
South Tyrol Free Software Conference
 
WSO2 ESB Integration with REST
WSO2 ESB Integration with RESTWSO2 ESB Integration with REST
WSO2 ESB Integration with REST
WSO2
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
Eugen Paraschiv
 
RESTful API-centric Universe
RESTful API-centric UniverseRESTful API-centric Universe
RESTful API-centric Universe
Tihomir 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 powned
Dinis Cruz
 
REST full API Design
REST full API DesignREST full API Design
REST full API Design
Christian Guenther
 
Web api
Web apiWeb api
Web api
udaiappa
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
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
Cisco DevNet
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIs
Giuseppe 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 platform
Nelson Kopliku
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
Aparna Sharma
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
Obaidur (OB) Rashid
 

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
 
RESTful_Web_Services_Presentation (1).pptx
RESTful_Web_Services_Presentation (1).pptxRESTful_Web_Services_Presentation (1).pptx
RESTful_Web_Services_Presentation (1).pptx
 
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
 

More from Ahmed Elbassel

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

Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
OKORIE1
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
q30122000
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Massimo Talia
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
PreethaV16
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 

Recently uploaded (20)

Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 

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