codecamp iasi 10 march 2012 - gabriel enea - asp.net web api

24
ASP.NET Web API in 30 min Gabriel ENEA Maxcode @dotnet18 / gabrielenea.blogspot.com 10 march 2012

Upload: codecampiasi

Post on 18-Nov-2014

2.725 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

ASP.NET Web API in 30 minGabriel ENEAMaxcode@dotnet18 / gabrielenea.blogspot.com

10 march 2012

Page 2: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API
Page 3: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

Agenda Background Web API overview, concepts, elements, architecture

if (codecamp.AvailableTime) { // run some demos me.Run.Demo1(); me.Run.Demo2(); } else { throw new UsualTimeoutException(); }

Page 4: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

Server vs. Client side UI processing

WebForms, 2002MVC, 2009

?, 2012

0

10

20

30

40

50

60

70

80

90

100

ClientServer

WebAPI

Page 5: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

What is ASP.NET Web API?

A framework that makes it easy to build HTTP services that reach a broad range of clients, including

browsers and mobile devices.

Page 6: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

Web API target: any device

Page 7: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

One ASP.NET Scott Hanselman (hanselman.com)

Page 8: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

Web API is built around…

URI - Uniform Resource Identifier HTTP communication protocol HTTP methods (GET, PUT, POST, and DELETE) 

Page 9: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

Do you love me ASP.NET MVC ?

Page 10: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

No, I love ASP.NET Web API Uses common concepts from ASP.NET MVC

ControllersRoutingModelModel BindingModel ValidationFiltersDependency InjectionSecurity

+HTTP content negotiation

Page 11: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

More about ASP.NET Web API Uses common concepts from ASP.NET MVC

ControllersRoutingModelModel BindingModel ValidationFiltersDependency InjectionSecurity

+HTTP content negotiation

Page 12: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

Web API - Routing

Based on a routing table, each HTTP message is mapped to an action.

Uses HTTP method name to select an action!

Page 13: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

1st demo

Comments management

Page 14: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

HTTP Message Handlers

Pipeline for processing HTTP messages on both the client and server.

src: http://blog.highwaterfilters.com/epa-wants-more-analysis-on-keystone-oil-sands-pipeline/

Page 15: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

HTTP Message Handlers

Built on some common objects:

HttpRequestMessage

HttpResponseMessage

HttpMessageHandler

Page 16: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

HTTP Message Handlers on Client - 1

Page 17: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

HTTP Message Handlers on Client - 2

Page 18: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

HTTP Message Handlers on Client - 3

Page 19: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

HTTP Message Handlers on Server

Page 20: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

More features - ASP.NET Web API Async support OData support Self-Host Media Formatters (built-in support for XML, JSON, and form-url encoded data)

Page 21: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

2nd demo

Client + Server in memory

Page 22: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

ASP.NET Web API in 30 min

No questions!?

Page 23: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

ASP.NET Web API - Resources

www.asp.net/web-api

Page 24: CodeCamp Iasi 10 March 2012 -   Gabriel Enea - ASP.NET Web API

ASP.NET Web API in 30 minGabriel ENEAMaxcode@dotnet18 / gabrielenea.blogspot.com

10 march 2012

src: http://idowindows.wordpress.com/2011/10/15/welcome-and-thank-you/

Pls. fill your eval. form