0
votes

I am trying to understand the PCL project in Xamarin.

I have figured out and read on the internet that XMLHttpWebRequest GetResponse() is not available under PCL. So far I understand this is because PCL provides only the subset of the targeted platforms. My question is: Which platform does not support this function?

When targeting .NET Framework 4.5, Android, iOS and Silverlight 5, this function doesn't exist. Because the project properties window says that these frameworks all support the same API (.NET 4.5) I assume that there shouldn't be any restrictions. What don't I understand here?

Further, when I create a Xamarin Shared Project and use GetResponse(), it compiles for Android.

1

1 Answers

0
votes

You can simply add the Microsoft.Bcl.Async package to your PCL via NuGet. This will allow you to use GetResponseAsync in your PCL code that targets Xamarin.