SlideShare a Scribd company logo
REST (RESTful) API
What is REST?
The five key principles are:
• Give every “thing” an ID
• Link things together
• Use standard methods
• Resources with multiple representations
• Communicate statelessly
HTTP methods
Without REST
With REST
Build simple RESTful API
• /getAllMembers
• /getAllCertificatedMembers
• /getMember/1
• /newMember
• /saveMember
It’s not OK
It’s OK
• POST /Members — Creation of a new member
• GET /Members — A list of all members in the system
• PUT /Members — An update to the all members
• DELETE /Members — Delete all members
• POST /Members/12345 — Return error (member 12345 are
created)
• GET /Members/12345 — Show member with ID 12345
• PUT /Members/12345 — Edit member with ID12345
• DELETE /Members/12345 — Delete
Hide the difficult method of the mark “?”
• GET /members?age=20&city=VN&location=park
• POST /members?age=25&city=VN
Support for multiple formats
Like this :
• /members.json
• /members/1234.json
Or support multiple type of
clients :
• /members.ios
• /members/1234.web
ASP.NET WEB API
Controller vs ApiController
Controller ApiController
Controller vs ApiController
MVC Controller Default Route
API Controller Default Route
Asp.Net Web API VS Asp.Net MVC
Asp.Net Web API
• to create HTTP services with
easy way that returns only data
• returning data in particular
format like JSON,XML
• the request are mapped to the
actions based on HTTP verbs
Asp.Net MVC
• to create web applications that
returns both views and data
• only return data in JSON format
• it is mapped to actions name.
Web API Parameter Bindings
• From Query-String: Using Model Binding
• From Body: Using different data formats like JSON, XML.
Routing
URL: localhost:3333/test/users/11/tweets
Status Code
RESTful API and ASP.NET

More Related Content

Viewers also liked

Welcome to the API Economy: Developing Your API Strategy
Welcome to the API Economy: Developing Your API StrategyWelcome to the API Economy: Developing Your API Strategy
Welcome to the API Economy: Developing Your API Strategy
MuleSoft
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Stormpath
 
Wso2 con byod-shan-ppt
Wso2 con byod-shan-pptWso2 con byod-shan-ppt
Wso2 con byod-shan-ppt
WSO2
 
Cross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San Francisco
CA API Management
 
Restful design principles
Restful design principlesRestful design principles
Restful design principles
Geison Goes
 
RESTful API development with Symfony2
RESTful API development with Symfony2RESTful API development with Symfony2
RESTful API development with Symfony2
Taras Omelianenko
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
Sachin G Kulkarni
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP Framework
Bo-Yi Wu
 
Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015
Nenad Pecanac
 
DataPower Restful API Security
DataPower Restful API SecurityDataPower Restful API Security
DataPower Restful API Security
Jagadish Vemugunta
 
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entitySpring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Toni Jara
 
Building REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring CloudBuilding REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring Cloud
Kenny Bastani
 
Building a Reactive RESTful API with Akka Http & Slick
Building a Reactive RESTful API with Akka Http & SlickBuilding a Reactive RESTful API with Akka Http & Slick
Building a Reactive RESTful API with Akka Http & Slick
Zalando Technology
 
APIs and Innovation
APIs and InnovationAPIs and Innovation
APIs and Innovation
Liad Bokovsky
 
China air conditioner market report
China air conditioner market reportChina air conditioner market report
China air conditioner market report
Beijing Zeefer Consulting Ltd.
 
A RESTful API for Controlling Dynamic Streaming Topologies
A RESTful API for Controlling Dynamic Streaming TopologiesA RESTful API for Controlling Dynamic Streaming Topologies
A RESTful API for Controlling Dynamic Streaming Topologies
Masiar Babazadeh
 
Plaquette Commerciale Phone Contact
Plaquette Commerciale Phone ContactPlaquette Commerciale Phone Contact
Plaquette Commerciale Phone Contactphonecontact
 
Education and Training for The Future Workforce
Education and Training for The Future WorkforceEducation and Training for The Future Workforce
Education and Training for The Future Workforce
WISE
 
Canada Digital Future 2014
Canada Digital Future 2014Canada Digital Future 2014
Canada Digital Future 2014
Counselorauto
 
SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?
SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?
SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?
cyrilpicat
 

Viewers also liked (20)

Welcome to the API Economy: Developing Your API Strategy
Welcome to the API Economy: Developing Your API StrategyWelcome to the API Economy: Developing Your API Strategy
Welcome to the API Economy: Developing Your API Strategy
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
Wso2 con byod-shan-ppt
Wso2 con byod-shan-pptWso2 con byod-shan-ppt
Wso2 con byod-shan-ppt
 
Cross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San Francisco
 
Restful design principles
Restful design principlesRestful design principles
Restful design principles
 
RESTful API development with Symfony2
RESTful API development with Symfony2RESTful API development with Symfony2
RESTful API development with Symfony2
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP Framework
 
Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015
 
DataPower Restful API Security
DataPower Restful API SecurityDataPower Restful API Security
DataPower Restful API Security
 
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entitySpring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
 
Building REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring CloudBuilding REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring Cloud
 
Building a Reactive RESTful API with Akka Http & Slick
Building a Reactive RESTful API with Akka Http & SlickBuilding a Reactive RESTful API with Akka Http & Slick
Building a Reactive RESTful API with Akka Http & Slick
 
APIs and Innovation
APIs and InnovationAPIs and Innovation
APIs and Innovation
 
China air conditioner market report
China air conditioner market reportChina air conditioner market report
China air conditioner market report
 
A RESTful API for Controlling Dynamic Streaming Topologies
A RESTful API for Controlling Dynamic Streaming TopologiesA RESTful API for Controlling Dynamic Streaming Topologies
A RESTful API for Controlling Dynamic Streaming Topologies
 
Plaquette Commerciale Phone Contact
Plaquette Commerciale Phone ContactPlaquette Commerciale Phone Contact
Plaquette Commerciale Phone Contact
 
Education and Training for The Future Workforce
Education and Training for The Future WorkforceEducation and Training for The Future Workforce
Education and Training for The Future Workforce
 
Canada Digital Future 2014
Canada Digital Future 2014Canada Digital Future 2014
Canada Digital Future 2014
 
SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?
SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?
SITB15 - Qu'est qu'une Data Driven Company à l'heure de la digitalisation ?
 

More from DelphiCon

React.js
React.jsReact.js
React.js
DelphiCon
 
No SQL
No SQLNo SQL
No SQL
DelphiCon
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
DelphiCon
 
SOLID
SOLIDSOLID
SOLID
DelphiCon
 
IoC and Dependency Injection
IoC and Dependency InjectionIoC and Dependency Injection
IoC and Dependency Injection
DelphiCon
 
Garbage collector
Garbage collectorGarbage collector
Garbage collector
DelphiCon
 
Frontend Workflow
Frontend WorkflowFrontend Workflow
Frontend Workflow
DelphiCon
 
Сборка Front-end’a
Сборка Front-end’aСборка Front-end’a
Сборка Front-end’a
DelphiCon
 
Effective email communications with a customer
Effective email communications with a customerEffective email communications with a customer
Effective email communications with a customer
DelphiCon
 

More from DelphiCon (9)

React.js
React.jsReact.js
React.js
 
No SQL
No SQLNo SQL
No SQL
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
SOLID
SOLIDSOLID
SOLID
 
IoC and Dependency Injection
IoC and Dependency InjectionIoC and Dependency Injection
IoC and Dependency Injection
 
Garbage collector
Garbage collectorGarbage collector
Garbage collector
 
Frontend Workflow
Frontend WorkflowFrontend Workflow
Frontend Workflow
 
Сборка Front-end’a
Сборка Front-end’aСборка Front-end’a
Сборка Front-end’a
 
Effective email communications with a customer
Effective email communications with a customerEffective email communications with a customer
Effective email communications with a customer
 

Recently uploaded

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 

Recently uploaded (20)

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 

RESTful API and ASP.NET

  • 3. The five key principles are: • Give every “thing” an ID • Link things together • Use standard methods • Resources with multiple representations • Communicate statelessly
  • 7. Build simple RESTful API • /getAllMembers • /getAllCertificatedMembers • /getMember/1 • /newMember • /saveMember It’s not OK
  • 8. It’s OK • POST /Members — Creation of a new member • GET /Members — A list of all members in the system • PUT /Members — An update to the all members • DELETE /Members — Delete all members • POST /Members/12345 — Return error (member 12345 are created) • GET /Members/12345 — Show member with ID 12345 • PUT /Members/12345 — Edit member with ID12345 • DELETE /Members/12345 — Delete
  • 9. Hide the difficult method of the mark “?” • GET /members?age=20&city=VN&location=park • POST /members?age=25&city=VN
  • 10. Support for multiple formats Like this : • /members.json • /members/1234.json Or support multiple type of clients : • /members.ios • /members/1234.web
  • 13. Controller vs ApiController MVC Controller Default Route API Controller Default Route
  • 14. Asp.Net Web API VS Asp.Net MVC Asp.Net Web API • to create HTTP services with easy way that returns only data • returning data in particular format like JSON,XML • the request are mapped to the actions based on HTTP verbs Asp.Net MVC • to create web applications that returns both views and data • only return data in JSON format • it is mapped to actions name.
  • 15. Web API Parameter Bindings • From Query-String: Using Model Binding • From Body: Using different data formats like JSON, XML.
  • 18.