I get the following error when trying to declare the ReadAsAsync <> extension method in retouching Bitrium.Http.Extensions System.Net.Http.Formatting.
The "SerializeToStreamAsync" method in the type 'System.Net.Http.ObjectContent' from the assembly 'Bitrium.Http.Extensions, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 43390f7aed073600' has no implementation.
I have something similar to the following code in a PCL project, which I am testing with a simple unit test. I do not implement a wait pattern, but I do not think this is related here.
public class RestApi()
{
public void Get()
{
HttpResponseMessage response = new HttpResponseMessage();
HttpClient client = new HttpClient();
response = client.GetAsync("http://someUrl.com").Result;
var modelList = response.Content.ReadAsAsync<List<Model>>().Result; // I get the exception here
}
}
Method call:
var target = new RestApi();
target.Get();
-, ? Async, , , .