Here I want to return integer like:
{
"statusCode": "200"
}
I am not getting statuscode
as a integer.
var response = new HttpResponseMessage();
response.StatusCode = Request.CreateResponse((HttpStatusCode)200;
public int DoHttpOperation(HttpClient client, parameters param)
{
url = "url which you want to hit";
client.DefaultRequestHeaders.Add("headername", "headervalue");
var response = //operation which you want to perfrom GET/PUT/POST/DELETE
return ((int)response.StatusCode); //Here you will o/p
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With