title: Sending Http requests from Xamarin Portable Class Library
body: <p>I have quite decent problems with this very simple task and asking for help.
  The question is: what is the best and the most reliable way to perform Http requests with timeout from Xamarin PCL?</p>
  
  <p>There are several options:</p>
  
  <ol>
  <li><p>Using old HttpWebRequest. This solution should definitely be working, but I have problems with BeginGetRequestStream method described in this question: <a href="https://stackoverflow.com/q/22572084/1645784">HttpWebRequest BeginGetRequestStream callback never called</a> Also it requres some extra ugly code to implement timeouts properly.</p></li>
  <li><p>HttpClient. HttpClient is not available in PCL out-of-the-box (I am using Profile 158 required by MvvmCross libraries). I was trying to install Microsoft HTTP Client Libraries but I still cannot compile the PCL project, error is: </p>
  
  <blockquote>
    <p>The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)</p>
  </blockquote></li>
  <li><p>PortableRest NuGet package. Same problem - does not seem to work in PCL. Lots of compilation errors and warnings, for example:</p>
  
  <blockquote>
    <p>The primary reference "System.Net.Http" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "System.Net.Http" or retarget your application to a framework version which contains "System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". (MSB3268) (Prototype.Core)</p>
  </blockquote></li>
  </ol>
  
  <p>What am I doing wrong? Why am I not able to use such basic standard libraries?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Finally solved the issue by switching to Profile 78 (.NET 4.5). Now I can use HttpClient which is way better and easy to use. It works reliably with all my requests. MvvmCross libraries work fine with Profile 78 as well.</p>
  
  <p>The only issue I have is lack of Timer class. Maybe I should implement it myself using Task.Delay.</p>