Five great reasons to use the new HttpClient API

Slides:



Advertisements
Similar presentations
Extending SharePoint Online met Windows 8 apps. Voorstellen.
Advertisements

PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
Taking Control of WCF Jay Hill Patrick Roeper Presentation Goals Take the most common WCF experience and make it better – Leverage OO design principles;
EECS 354 Network Security Cross Site Scripting (XSS)
Martin Kruliš by Martin Kruliš (v1.0)1.
Final Presentation Liat Ben-Ami Yonathan Perez Instructor: Roy Mitrany.
HTTP – HyperText Transfer Protocol
Web basics HTTP – – URI/L/Ns – HTML –
How the web works: HTTP and CGI explained
Hypertext Transfer Protocol Information Systems 337 Prof. Harry Plantinga.
Host Message Handlers Controller Model Bindings Result Conversion Action Method.
Hypertext Transport Protocol CS Dick Steflik.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
PL-IV- Group A HTTP Request & Response Header
Mark Phillip markphillip.com 200s, 304s, Expires Headers, HTTP Compression, And You.
TP2653 Adv Web Programming SOAP and WSDL. SOAP Simple Object Access Protocol – Lightweight XML-based messaging protocol – A protocol for accessing a Web.
1 Advanced Application and Web Filtering. 2 Common security attacks Finding a way into the network Exploiting software bugs, buffer overflows Denial of.
CVSQL 2 The Design. System Overview System Components CVSQL Server –Three network interfaces –Modular data source provider framework –Decoupled SQL parsing.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
XSS Without the Browser Wait, what? Toorcon Seattle, 2011.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Universal HTTP Denial-of-Service. About Hybrid Creating web-business-logic security Doing cool stuff in AI research Optimizing acceptance rate for Web-bound.
ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:
LiNK: An Operating System Architecture for Network Processors Steve Muir, Jonathan Smith Princeton University, University of Pennsylvania
The Evils of Copy and Paste Presented by Daniel Daugherty
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
“Thanks guys for a great information packed day. head is spinning!” “Well done guys. Intense sessions” “This is the best ever JumpStart that I have.
Lewis Benge. // using Windows.Networking; // using Windows.Networking.Sockets; var socket = new StreamSocket(); var hostName = new HostName("example.com");
Consuming REST Services from C# SoftUni Team Technical Trainers Software University
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
10 Reasons to Choose the Yii Framework. The development of Yii framework began on January 1, 2008.Yii framework It is an open source application that.
Advanced Windows 8 Apps Using JavaScript Jump Start Exam Prep M5: Data, Files, and Encryption Michael Palermo Microsoft Technical Evangelist Jeremy.
Forensic Drupal Debugging Dan Harris daneesia on drupal.org.
Shibboleth and IIS Integration Tips, Tricks, Alternatives
CSE 461 HTTP and the Web. This Lecture  HTTP and the Web (but not HTML)  Focus  How do Web transfers work?  Topics  HTTP, HTTP1.1  Performance Improvements.
Web Server Design Assignment #1: Basic Operations Due: 02/03/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
HTTP Geolocation Header draft-thomson-geopriv-http-geolocation-00 IETF 80, Prague.
IAsyncResult ar = BeginSomething(…); // Do other work, checking ar.IsCompleted int result = EndSomething(ar);
Offline Web Apps - an offline web application is a list of URLs for HTML, CSS, JavaScript, images, or any other kind of resource. Most browsers have offline.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
Simplicity Tile Update Notification Service Tile Update Notification Service SOAP Windows Communication Foundation Windows Web Services SOAP.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
Web Technologies Lecture 11 Implementing RESTful services.
Tips & Tricks: Writing Performant Managed Code Rico Mariani FUNL04 Performance Architect Microsoft Corporation.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Data-Plane Verification COS 597E: Software Defined Networking.
Test for timestamp : measure code execution time.
What web developers need to know when building Metro style apps Scott Dickens Principal Program Manager Lead Microsoft Corporation DEV352.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
APLIKACIJE KOJE SU IZVAN SEBE Domagoj Pavlešić, dizzy.hr.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
#SummitNow CORS 6 Nov 2013 / 14 Nov 2013 Jared Ottley / Alfresco Software.
Developing for Chromecast Cast Companion Library & Custom Receiver Application.
4.3. Code animations by using JavaScript Access data access by using JavaScript. Creating Animations, Working with Graphics, and Accessing Data.
Varnish Cache and its usage in the real world Ivan Chepurnyi Owner EcomDev BV.
Module 4: Troubleshooting Web Servers. Overview Use IIS 7.0 troubleshooting features to gather troubleshooting information Use the Runtime Control and.
WCF 4.0: Routing & Discovery Services
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
CloudFront: Living on the Edge
Using the right networking APIs for your Universal Windows app
Making apps social and connected with HTTP services
What’s New in ChakraCore
Jeremy Foster Michael Palermo
Debugging tips and tricks
Developer Productivity: What’s New in C# 6
COP Process.
Presentation transcript:

Five great reasons to use the new HttpClient API Windows Azure 4/26/2017 Five great reasons to use the new HttpClient API Peter Smith Program Manager 4-092 © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 top reasons to use the new HttpClient API Build 2012 4/26/2017 5 top reasons to use the new HttpClient API Reason C++ C# JavaScript Shared cache, cookies, credentials ✔ new! ✔ new! ✔ new! Strongly typed headers=fewer bugs in less time ✔ new! new! Access to cookies and shared cookies new! new! new! Control over caching and shared cache new! ✔ new! Inject your code modules into the processing pipeline=cleaner, more modular code © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Meet the family! ⛭ HttpClient Http Base Protocol Filter Your App Build 2012 4/26/2017 Meet the family! HttpClient (has common send methods) Http Base Protocol Filter (has in-depth settings) Your App REST/Web Service HttpRequestMessage HttpResponseMessage ⛭ HttpContent String • Stream • Buffer • Multipart • FormUrlEncoded © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Build 2012 4/26/2017 Simple example try { var uri = new Uri("http://example.com/datalist.aspx"); var httpClient = new HttpClient(); var result = await httpClient.GetStringAsync(uri); } catch (Exception e) © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Let’s see it in action! Build 2012 4/26/2017 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Reason #1: HTTP Integration: cache, cookies, credentials… Build 2012 4/26/2017 Reason #1: HTTP Integration: cache, cookies, credentials… © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Build 2012 4/26/2017 Cache, cookies, credentials are already shared between <WebView>, <Image>, <Media>, … These shared with Windows.Web.Http, too (but not shared across apps) © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Reason #2: Strongly typed headers: fewer bugs in less time Build 2012 4/26/2017 Reason #2: Strongly typed headers: fewer bugs in less time © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Strongly typed headers Build 2012 4/26/2017 Strongly typed headers Headers are easy to mistype The errors are hard to spot Even big sites make mistakes Pramga:no-cache LastModified:Fri, 08 Mar 2013 19:26:00 GMT Cneonction:close ntCoent-Length:190946 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Build 2012 4/26/2017 Host // HostName is part of the Windows.Networking namespace. var request = new HttpRequestMessage(); request.Headers.Host = new HostName("contoso.com"); © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Build 2012 4/26/2017 Content-Length ulong len = response.Content.Headers.ContentLength.Value; byte[] buffer = new byte[len]; © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Last-Modified DateTimeOffset d = response.Content.Headers.LastModified.Value;

Setting a custom header // Add a custom header to the request. request.Headers.TryAppendWithoutValidation ("X-Requested-With", "XMLHttpRequest");

List all headers // List all the headers in the response and response.Content. foreach (var header in httpResponse.Headers) { Log (header.Key + "=" + header.Value); } foreach (var header in httpResponse.Content.Headers)

Reason #3: list, set and delete cookies Build 2012 4/26/2017 Reason #3: list, set and delete cookies © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Build 2012 4/26/2017 How to set a cookie var bpf = new HttpBaseProtocolFilter(); var cookieManager = bpf.CookieManager; var cookie = new HttpCookie("myCookieName", ".example.com", "/"); cookie.Value = "myValue"; cookieManager.SetCookie(cookie); // Use this base protocol file with an HttpClient var httpClient = new HttpClient(bpf); © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Let’s see it in action!

Reason #4: Influence over the system network cache Build 2012 4/26/2017 Reason #4: Influence over the system network cache © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Where did my data come from? var httpResponse = await httpClient.GetAsync(uri); switch (httpResponse.Source) { case HttpResponseMessageSource.Cache: break; case HttpResponseMessageSource.Network: break; case HttpResponseMessageSource.None: break; }

Cache write behavior var bpf = new HttpBaseProtocolFilter(); // Set the WriteBehavior. bpf.CacheControl.WriteBehavior = HttpCacheWriteBehavior.Default; bpf.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache; // Use the base protocol filter in an HttpClient var hc = new HttpClient(bpf);

Build 2012 4/26/2017 Cache read behavior var bpf = new HttpBaseProtocolFilter(); // Set the ReadBehavior. bpf.CacheControl.ReadBehavior = HttpCacheReadBehavior.Default; bpf.CacheControl.ReadBehavior = HttpCacheReadBehavior.MostRecent; bpf.CacheControl.ReadBehavior = HttpCacheReadBehavior.OnlyFromCache; // Use the base protocol filter in an HttpClient var hc = new HttpClient(bpf); © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Reason #5: The HTTP Processing pipeline includes your filter code Build 2012 4/26/2017 Reason #5: The HTTP Processing pipeline includes your filter code © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Remember this diagram? ⛭ HttpClient Http Base Protocol Filter Your App Build 2012 4/26/2017 Remember this diagram? HttpClient (has common send methods) Http Base Protocol Filter (has in-depth settings) Your App REST/Web Service HttpRequestMessage HttpResponseMessage ⛭ HttpContent String • Stream • Buffer • Multipart • FormUrlEncoded © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

The filter pipeline ⛭ HttpClient Http Base Protocol Filter Your App Build 2012 4/26/2017 The filter pipeline HttpClient (has common send methods) 503 Retry Filter Metered Network Filter Auth Filter Http Base Protocol Filter (has in-depth settings) Your App REST/Web Service HttpRequestMessage ⛭ HttpResponseMessage HttpContent String • Stream • Buffer • Multipart • FormUrlEncoded © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Let’s see it in action! Build 2012 4/26/2017 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

IHttpFilters Filters are WinRT Components Build 2012 4/26/2017 IHttpFilters Filters are for: Auth Custom caches Logging Network Restrictions Retry Testing Filters are WinRT Components They implement Windows.Web.Http.Filters.IHttpFilter It’s just one method: SendRequestAsync (+dispose) You put them into the filter pipeline Most pipelines end with a HttpBaseProtocolFilter Each filter sees all requests going out And all responses coming back And can modify them © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Recap HttpClient Your App Http Base Protocol Filter Build 2012 4/26/2017 Recap HttpClient Delete Get Post Put SendRequestAsync DefaultRequestHeaders 503 Retry Filter Metered Network Filter Auth Filter Http Base Protocol Filter Your App REST/Web Service HttpRequestMessage HttpResponseMessage HttpContent String • Stream • Buffer • Multipart • FormUrlEncoded © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 top reasons to use the new HttpClient API Build 2012 4/26/2017 5 top reasons to use the new HttpClient API Reason C++ C# JavaScript Shared cache, cookies, credentials ✔ new! ✔ new! ✔ new! Strongly typed headers=fewer bugs in less time ✔ new! new! Access to cookies and shared cookies new! new! new! Control over caching and shared cache new! ✔ new! Inject your code modules into the processing pipeline=cleaner, more modular code © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Reasons 6 and up… HttpProgress Build 2012 4/26/2017 Reasons 6 and up… HttpProgress SSL/TLS errors/certificates (including stronger security) Streaming uploads & Streaming downloads Additional settings on HttpBaseProtocolFilter Make your own IHttpContent & IHttpFilter classes Configuring the OAuth 2.0 filter Server/Proxy credentials Client certificate © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Build 2012 4/26/2017 How to get started HttpClient sample has lots of code and the metered network filter and the 503 retry filter Web Authorization Broker sample has an OAuth 2.0 filter MSDN documentation (look under Windows.Web.Http) MSDN Windows Store apps forums © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Resources 3-090: Building great service connected apps 4/26/2017 Resources 3-090: Building great service connected apps 3-113: Building a great authentication experience into your app //build/ 2011 PLAT-785T: Creating connected apps that work on today’s networks Windows app developer blog April 10, 2013: Creating connected Windows Store apps © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

What to do next? Find and use filters Make and share filters Build 2012 4/26/2017 What to do next? Find and use filters Make and share filters Update your code to use the new classes © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4/26/2017 5:02 AM Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub. Evaluate this session Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize! © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.