SlideShare uma empresa Scribd logo
1 de 20
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

Mais conteúdo relacionado

Destaque

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 StrategyMuleSoft
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 
Wso2 con byod-shan-ppt
Wso2 con byod-shan-pptWso2 con byod-shan-ppt
Wso2 con byod-shan-pptWSO2
 
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 FranciscoCA API Management
 
Restful design principles
Restful design principlesRestful design principles
Restful design principlesGeison Goes
 
RESTful API development with Symfony2
RESTful API development with Symfony2RESTful API development with Symfony2
RESTful API development with Symfony2Taras 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 CodeigniterSachin 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 FrameworkBo-Yi Wu
 
Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Nenad Pecanac
 
DataPower Restful API Security
DataPower Restful API SecurityDataPower Restful API Security
DataPower Restful API SecurityJagadish 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 entityToni 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 CloudKenny 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 & SlickZalando Technology
 
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 TopologiesMasiar 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 WorkforceWISE
 
Canada Digital Future 2014
Canada Digital Future 2014Canada Digital Future 2014
Canada Digital Future 2014Counselorauto
 
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
 

Destaque (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 ?
 

Mais de DelphiCon

Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on RailsDelphiCon
 
IoC and Dependency Injection
IoC and Dependency InjectionIoC and Dependency Injection
IoC and Dependency InjectionDelphiCon
 
Garbage collector
Garbage collectorGarbage collector
Garbage collectorDelphiCon
 
Frontend Workflow
Frontend WorkflowFrontend Workflow
Frontend WorkflowDelphiCon
 
Сборка Front-end’a
Сборка Front-end’aСборка Front-end’a
Сборка Front-end’aDelphiCon
 
Effective email communications with a customer
Effective email communications with a customerEffective email communications with a customer
Effective email communications with a customerDelphiCon
 

Mais de 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
 

Último

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
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
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
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
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
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 Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 

Último (20)

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
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...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
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, ...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
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
 
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
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 

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.