Ramco Ramco

Ramco Ramco

  • 419
  • 3.4k
  • 547.9k

How to display message

Dec 26 2022 6:13 AM

Hi

  I have below code & i want if successfully done then Sucess message should get displayed else if there ie error or Awb no does not exists then it should show some message

var client = new RestClient("api.nimbuspost.com/v1/shipments/cancel");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");

var body = @"{" + "\n" +
@"    ""email"" : ""[email protected]""," + "\n" +
@"    ""password"" : ""T!""" + "\n" +
@"awb : " + awb + " \n" +
@"}";
request.AddHeader("Authorization", "Bearer " + token);
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

Thanks


Answers (16)