0

I have webapi post method which returns an integer values between 1 and 5 based on certain criteria when a call is made from a WPF application. The api is working well and returns status 200 when called.

Issue: I want to access the integer value returned in the response.

webapi:

 [System.Web.Http.HttpPost]
        public int ValidateLicence(dto_User user)
        {
                var result = _repository.ValidateLicence(user);
            return result;

        }

reponse (wpf):

var response = await client.PostAsJsonAsync("/api/User/ValidateLicence/", licence);
codegrid
  • 977
  • 2
  • 13
  • 33
  • 1
    Possible duplicate of [Get response from PostAsJsonAsync](http://stackoverflow.com/questions/15205389/get-response-from-postasjsonasync) – ChrisBint Mar 02 '16 at 16:46
  • Not helpful @ChrisBint. I need someone to point me in the right direction. – codegrid Mar 02 '16 at 16:59
  • Run a communications trace and tell us what is being returned. What do you get in the response? Nothing? – JWP Mar 02 '16 at 19:48
  • I have resolved it by changing the api `post` method to a `get` method and `PostAsJsonAsync` to `GetAsync`. – codegrid Mar 02 '16 at 22:04

0 Answers0