Hello Experts
I am using restSharp to send a requset to external API.
So first thing I createed two class libraries using RestSharp on for token and the other for send SO
Now i need to receive the IRestResponse in a object in x to check the status code
in the class library I am using
var client = new RestClient(_uri);
client.Timeout = -1;
string token = "Bearer " _token;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", token);
request.AddHeader("Content-Type", "application/json");
var jsonConverted = JsonConvert.SerializeObject(_json);
request.AddParameter("application/json", jsonConverted, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
return response.Content;
but the content doesn't has the status code , the status code in the (IRestResponse)
IRestResponse response = client.Execute(request);
Thanks