Hi
I am getting below error -
{"status":false,"message":"awb is required\n"}
var awb = "321896356723";
var client = new RestClient("htps://api.nimbuspost.com/v1/shipments/cancel");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
var body = $@"{{ ""awb"": [ ""{awb} ""]}}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Thanks
Pasang TamangPosted Jan 12, 2023, 6:56 AM
Hi,
Looking into your code, it looks string formation of body is not correct. Please try by replacing your body formation code with below code.
Regards,
Pasang
Vishal JoshiPosted Jan 12, 2023, 7:06 AM
Hello
You should try using JSONConvert from JsonNewtonsoft. try below code.
Thanks