Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in sending HTTP requests in Windows Phone 7.1

I am trying to send a HTTP request in Windows Phone using Visual Studio 2010 Express, but I am getting this error:

The type or namespace name 'HttpClient' could not be found (are you missing a using directive or an assembly reference?)

It's not able to find HttpClient even when I used using system.windows.httpclient. I am not able to get which reference is actually missing.

What reference do I need to add? Or what do I need to do to resolve this issue?

like image 401
Shailee Avatar asked Jan 23 '26 22:01

Shailee


1 Answers

You have two options here.

  1. You must use Visual Studio 2012 or superior.
  2. Replace your HttpClient class with WebClient or HttpWebRequest.

You cannot use HttpClient with Visual Studio 2010, no Framework 4.5 supported.

like image 124
Christian Amado Avatar answered Jan 26 '26 10:01

Christian Amado