Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Five Great Reasons to Use the New HttpClient API to Connect to Web Services

Download

Right click “Save as…”

Slides (view online)
+ My Schedule- My Schedule
The new Windows.Web.Http.HttpClient family of classes lets you connect to web services easily and with lots of control. In this talk you’ll learn about these new classes, how and when to use them, how to connect to popular web services, and how to control your caches and cookies. You'll also learn new ways to speed up your app start-up by prudently pre-stocking your HTTP cache with data you know your users will want.
For more information, check out this course on Microsoft Virtual Academy:

Follow the Discussion

  • where can I find windows.web.http (framework 4.5.1) namespace/library installed and later reference? Thanks

  • and you just mentioned having that namespace available in MSDN. I was looking for it and never found... could you provide the link?

  • jans: The new home of HttpClient is NuGet package Microsoft.Net.Http.

  • while selecting speakers for talks MS need to test their voices @ 2x speed. Some are just impossible to listen to @ 1.4x or @2x speeds like this speaker

  • Jans -- there are three HttpClient APIs in Windows.  This talk is all about the new 81. Window.Web.Http HttpClient; it's a WinRT component that works with C++, C#, VB and for JavaScript 'WWA' app store apps.  (It also works for desktop apps).

     

    There's also the .NET HttpClient that was introduced with 4.5, plus a Portable Class Library (PCL) HttpClient that just reached (IIRC) version 2.1 and which works with .NET 4.0.  But those are different.

     

     

  • can a filter be used to assign unique IP address to each instance of httpclient?

  • @WeCarpoolCOM: We don't give you quick that much power!  What scenario do you have that you need to assign IP addresses like this?

  • @PeSmith Where can we get that poster you provided at the talk?

  • 3 questions: Can I do custom validation of the SSL certificate?  

    Can I do custom validation of the SSL connection?  I want to be aware of BEAST, CRIME, and other vulnerabilities my client is open to.  (see security.stackexchange.com ).  Related questions: Am I using TLS 1.0 or 1.1?  What cipher and encryption is the connection using?

    Can I check the "issued by" parameter of each SSL certificate?  I want to determine if an in-line SSL proxy filter is inspecting my traffic (Bluecoat corporate proxy)

    How many concurrent connections are allowed to the same fqdn?  Traditionally, in IE and javascript I am limited to the number of concurrent HTTP calls I can have to a given domain.  How is this limitation applied to C# and the other platforms?

  • The forums at http://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?category=windowsapps81preview are a great place to ask questions like these -- the moderators are very active at answering questions.

    Yes, you get some information about the SSL connection.  In particular the HttpRequestMessage has a TranportInformation property that includes the SSL certificate.  For validation, I'd recommend creating a simple filter that, on getting a response, checks the responses' httpRequest message for the transport information.  If you decide that the SSL isn't good enough, you can then just kill the response entirely.  By placing the check in a filter, you can have a good check without having to clutter up the rest of your app logic.

    The TransportInformation ServerCertificate is an ordinary Windows.Security.Cryptography.Certificates.Certifcate object.  That object includes an Issuer.

    You can control the number of connection with the HttpBaseProtocolFilter "MaxConnectionsPerServer" value.

     

  • We passed out a nifty poster at this session (and then later at one of the booths in the Big Room).  An enhanced version of that poster is now on the Download Center; check it out at http://download.microsoft.com/download/0/2/8/02809141-3329-4412-8AC4-AA41B406055C/WinRT81%20HttpClient%20Poster.pdf

    The poster prints out at 11x17 ("tabloid") size.  The poster includes the various classes that make up the HttpClient family of classes and how they interrelate and includes 5 small code samples that demonstrate using the classes.

     

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.