11

I'm recieving an object of type System.Net.Http.HttpResponseMessage<List<T>>, how do I get the List<T>?

I tried casting the content property and getting a value from the content property via its value property but nothing seems to work.

Thanks for the help!

Alexander Zeitler
  • 11,919
  • 11
  • 81
  • 124
Nicolas Straub
  • 3,381
  • 6
  • 21
  • 42

2 Answers2

15

You can use the .ReadAsAsync<List<T>> method of the Content property.

Please also read my sample from this answer.

Update: These extension methods are located in the System.Net.Http.Formatting namespace inside the NuGet Package Microsoft.AspNet.WebApi.Client.

Community
  • 1
  • 1
Alexander Zeitler
  • 11,919
  • 11
  • 81
  • 124
8

This is no longer possible. Check this out: http://aspnetwebstack.codeplex.com/discussions/350492

lnaie
  • 1,011
  • 13
  • 16