0

I'm getting the response after calling the API for token,

How can I read the contents of the response?

This is the code to get the token, which works

 var client = new RestClient("http://localhost:54580/token");
 var oAuthRequest = new RestRequest(Method.POST);      
 oAuthRequest.AddHeader("content-type", "application/x-www-form-urlencoded");
 oAuthRequest.AddParameter("application/x-www-form-urlencoded", "grant_type=password&username=kas1@sample.com&password=Kas12345", ParameterType.RequestBody);

The response message comes here,

IRestResponse response = client.Execute(oAuthRequest);

Now I want to read the contents of the response. I tried different options no luck. Any help is appreciated

kas_miyulu
  • 335
  • 1
  • 5
  • 27

0 Answers0