Consuming REST services using HttpClient

digg_url = “”;digg_title = “Consuming REST services using HttpClient”;digg_bgcolor = “#555555”;digg_skin = “normal”; = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

If you have a need to consume REST Services from .NET Framework based code, then you should really have look at the WCF Rest Starter Kit.  There is a handy class called HttpClient that is, in my opinion, provides the best / cleanest way to consume REST services at the http level.  Essentially, it gives you the ability to make http calls as easy as:


There is so much more to HttpClient than the little snippet above, including ways to easily hydrate / deserialize the response of the REST service into a .NET types.  You have quite a bit of power / control over the common REST service consumption scenarios.  There’s a nice little blog post over at The .NET Endpoint blog which covers HttpClient.  The BEST starting point, again my opinion, for learning about HttpClient is these two Ch. 9 screencasts by Aaron Skonnard:

Once you’ve watched the screencasts and read the blog post, then you will probably want to learn a bit more about the WCF REST Starter Kit.  Here’s a great overview of the kit (also by Aaron Skonnard):

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s