Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpResponseMessage #18

Open
silentsnow2010 opened this issue Jun 29, 2016 · 1 comment
Open

HttpResponseMessage #18

silentsnow2010 opened this issue Jun 29, 2016 · 1 comment
Labels

Comments

@silentsnow2010
Copy link

silentsnow2010 commented Jun 29, 2016

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 akilb added the question label Sep 29, 2016
@akilb
Copy link

akilb commented Sep 29, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants