ASP.NET WEB API Napredne tehnike i mogućnosti RENATO JOVIĆ, Tagit Adriatica d.o.o.

Slides:



Advertisements
Similar presentations
Attie Naude 14 May 2013 Windows Azure Mobile Services.
Advertisements

1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Web API for Mobile JaxARCSIG April About Me David Fekke L.L.C. Mobile apps for iOS Regular presenter at JaxDUG, JSSUG and JaxFusion Writing Web.
1 Caching in HTTP Representation and Management of Data on the Internet.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
What’s a Web Cache? Why do people use them? Web cache location Web cache purpose There are two main reasons that Web cache are used:  to reduce latency.
1 HTTP - Hypertext Transfer Protocol Arthur : Yigal Eliaspur Date :
Implementing ISA Server Caching. Caching Overview ISA Server supports caching as a way to improve the speed of retrieving information from the Internet.
Hypertext Transfer Protocol Information Systems 337 Prof. Harry Plantinga.
06 | Implementing Web APIs Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Host Message Handlers Controller Model Bindings Result Conversion Action Method.
Nikolay Kostov Telerik Corporation
1 Caching  Temporary storage of frequently accessed data (duplicating original data stored somewhere else)  Reduces access time/latency for clients 
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control Maarten
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Krerk Piromsopa. Web Caching Krerk Piromsopa. Department of Computer Engineering. Chulalongkorn University.
HTTP Protocol Specification
Remotely authenticating against the Service Framework.
Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger.
ASP. Net is a rich web framework that leverages well known patterns and JavaScript frameworks to build great web experiences quickly.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:
Getting Started with the ASP.NET Web API Dhananjay Kumar Infragistics Consultant Microsoft MVP
Building HTTP Services with ASP.NET Web API Sayed Ibrahim Hashimi Program Manager Microsoft Corporation DEV309.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
ASP.NET Web API. ASP.NET Members MS Open Source ASP.NET MVC 4, ASP.NET Web API and ASP.NET Web Pages v2 (Razor) now all open source ASP.NET MVC 4, ASP.NET.
Caching Chapter 12. Caching For high-performance apps Caching: storing frequently-used items in memory –Accessed more quickly Cached Web Form bypasses:
Web Service Programming with WCF 3.5 Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog:
1 Caching in HTTP Representation and Management of Data on the Internet.
Building Secure Web Applications With ASP.Net MVC.
HTTP support for caching & replication. Conditional requests Server executes conditional request. Responds with a message body only if the condition is.
Web Cache Consistency. “Requirements of performance, availability, and disconnected operation require us to relax the goal of semantic transparency.”
On The Cooperation of Web Clients and Proxy Caches Yiu Fai Sit, Francis C.M. Lau, Cho-Li Wang Department of Computer Science The University of Hong Kong.
Building a Web API for browser/JSON clients.
ASP.NET Web API – Sigurnosna pitanja i odgovori Ivan Marković Cloud Solutions Program Manager/Technology Evangelist SPAN.
06 | HTTP Services with Web API Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist.
ICM – API Server & Forms Gary Ratcliffe.
WEB-API & MVC5 - Identity & Security Mait Poska & Andres Käver, IT Kolledž 2014.
APLIKACIJE KOJE SU IZVAN SEBE Domagoj Pavlešić, dizzy.hr.
Today’s Applications Web API Browser Native app Web API Web API
EDISCOVERY AND ARCHIVING IN OFFICE 365 Scott Schnoll, Microsoft Corporation.
Cross-platform s Apache Cordovom i Visual Studijom Petar Kovačević, Axilis d.o.o.
#SummitNow CORS 6 Nov 2013 / 14 Nov 2013 Jared Ottley / Alfresco Software.
Vladan Strigo CTO NETmedia ASP.NET Web Api Tips & Tricks.
Sander Berkouwer Microsoft MVP Directory Services Microsoft Netherlands Virtual Technical Evangelist Blogger on DirTeam.com ServerCore.Net.
Internet of Things Windows IoT for small devices CATALIN GHEORGHIU I Computer Solutions.
Release management na Azure platformi RENATO ŽELEZNJAK, Ekobit.
Poslovi u budućnosti IT- a Marin Mamić, Microsoft.
AZURE LOGIC APPS SERVICE BRANKO VLAISAVLJEVIĆ, Ekobit.
SKYPE4B Cloud PBX w/ PSTN Omar Kudović, Microsoft BiH.
BUILD SECURE PRODUCTS AND SERVICES
State Management Cookies, Sessions SoftUni Team State Management
Hello World Admir Tuzović Chief Technology App Impact
Node.js Express Web Applications
WEB-API & MVC5 - Identity & Security
ASP.NET Web Forms and Web Services
Web Caching? Web Caching:.
MVC in ASP.NET Core: The new kid on the block
Controllers.
Configuring Internet-related services
Authorization in Asp.Net Core
Building HTTP Services with ASP.NET Web API
Building HTTP services for modern client apps
TechEd /22/2019 9:22 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Building production-ready APIs with ASP.NET Core 2.2
WCF Data Services and Silverlight
Chengyu Sun California State University, Los Angeles
Presentation transcript:

ASP.NET WEB API Napredne tehnike i mogućnosti RENATO JOVIĆ, Tagit Adriatica d.o.o.

Agenda ASP.NET WebAPI pipeline overview Message Handlers (DelegatingHandler) Filters (ActionFilterAttribute) Formatters (MediaTypeFormatter) Exception Handling ExceptionLogger ExceptionHandler Caching Streaming (upload & download) What’s new in Web API 2

ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. It is an ideal platform for building RESTful applications on the.NET Framework ASP.NET WebAPI

ASP.NET WebAPI pipeline Host Message Handlers Controller Model Binding Result conversion Action Method

Journey of HTTP message

MESSAGE HANDLERS

HTTP message handlers are the first stage in the processing pipeline. They process HTTP request messages on the way in, and HTTP response messages on the way out. Derive from DelegatingHandler Global or per-route handlers Message Handlers

Delegating handler #1 Delegating handler #2 HttpRouting Dispatcher HttpController Dispatcher Host Controller

MESSAGE HANDLERS Demo

FILTERS

Filters are great way to add extra functionality to your Web API service or to secure your controllers and actions. WebAPI filters != MVC filters Filters

Authentication filter Authorization filter Action filters Controller Action Method Model Binding Result conversion Result conversion – out of the box formatters for JSON/XML/BSON (v2) Ability to easy write your own custom formatters (results) – CSV, vCard …

FILTERS & FORMATTERS Demo

ERROR HANDLING

Client error – HTTP 4xx Server error – HTTP 5xx Avoid try/catch in controller actions Error handling

ExceptionHandler Handler for catching exception in pipeline One handler at the time ExceptionLogger Handler for logging the exceptions Multiple handlers at the time IMPORTANT : Doesn’t catch exception caused by: Serialization errors, controller initialization, pre/post controller

EXCEPTION HANDLING Demo

HTTP CACHING

Http caching - client Cache-Control no-cache (default) no-store max-age (TTL, seconds) Private (no store at proxies) Expires Default value (-1) Date of expiration – UTC – Can be year from now – max-age from Cache- Control have advantage

Http caching - server WebAPI doesn’t support OutputCache MVC filter Two possibilities – Manually adding caching header to response (Etag value) – Use third party stuff (CacheCow, OutputCache…)

Http caching - ETag Response header name – Etag Request header name – If-None-Match Client sends Etag inside request headers Server compare received Etag with resource Etag value RESPONSE – HTTP 304 (Not modified) Server returns updated resource with new Etag Client caches response == !=

HTTP CACHING Demo

HTTP STREAMING

Chunked transfer - download System.Net.Http.StreamCont ent Pull data direct from the file Avoids creating local byte array data to hold the file System.Net.Http.PushStreamCon tent Size is not known Use stream Flush() to send chunk of data to the client

Chunked transfer - upload System.Net.Http.HttpContent.ReadAsStreamAsync System.Net.Http.HttpContent.ReadAsStreamMultipartA sync Non-browser file upload Stream data direct to the file on the server Browser file upload (form data)

HTTP STREAMING Demo

What’s new in WebAPI 2 Out of the box support for BSON using JSON.NET library Attribute routing (Route and RoutePrefix) Odata improvements CORS (Cross Origin Request Sharing) New IHttpResult response – return Ok(); – return NotFound(…);

@rjovic

Nagrađujemo vas sa 100 WinCoin bodova što ste posjetili predavanje. Osvojite dodatnih 100 WinCoin bodova ukoliko popunite službeni upitnik. HVALA!