Null response in REST API course

Hi Xamarin community,

When I am applying this exercise:
https://docs.microsoft.com/en-us/learn/modules/consume-rest-services/4-exercise-consume-rest-service-with-httpclient

I noticed that the response is null:

Anyone can help me in getting the body of the response?

Answers

  • Hadi_AleidHadi_Aleid Member ✭✭

    up

  • avelikiaveliki Member

    Hi,
    Do You know send **post **request on server with xamarin forms?
    I am having huge issues, it is not working :disappointed:

  • Jason_DeBoeverJason_DeBoever USXamarin Team, University, XamUProfessors Xamurai

    Hi @Hadi_Aleid,

    I updated the server code so that it returns the object as well a Location header so that it's consistent with our example code.

    A couple things to note though: (1) Most servers will not respond back with the same object you just POST'ed, so don't be surprised when that isn't available elsewhere. Instead you would look to the Location Header to get the address of the newly inserted item. (2) Even with the server changed, the client will still not show the new item in the list right away. You will need to hit refresh on the toolbar to see the newly inserted item.

  • logeshpalani98logeshpalani98 USMember ✭✭✭

    You can de-serialize Data not respone

Sign In or Register to comment.