viagogo / HalKit

A lightweight .NET library for creating and consuming HAL hypermedia APIs
MIT License
16 stars 8 forks source link

HttpResponseMessage #18

Open silentsnow2010 opened 8 years ago

silentsnow2010 commented 8 years ago

Hi ,

if i use :

var xMsg = await api.PostAsync < HttpResponseMessage > (link, object);

the xMsg always come (NULL)

noting that , Fiddler shows to me the request and the response are correct and the Status Code is 201 but once it receive to the client it came as NULL

akilb commented 8 years ago

Hi @silentsnow2010,

Sorry for the delay in getting back to you. Did you solve this already? The issue here is that PostAsync<T> tries to deserialise the response body into an object of type T. xMsg is probably NULL because the response body is empty. On top of that you won't be able to deserialise the response body into an HttpResponseMessage - you should create your own class that matches the JSON content of the response.

Hope this helps.