My question:
A vendor had created 3 rest api and given to me for consuming.I used the c# code generated through postman and i was able to consume 2 api.One of the API though has been giving internal server error 500.But when i test it through postman ,the API works.Now the vendor is putting the blame on me ,that if the API works on postman their job is done.Is there a possibility ,that code may work through postman and not through c# code?The code is hardly 10 lines and i have double checked all the parameters .I used Rest Sharp library.This code was working 3 weeks ago and the vendor that time hadnt handled mobile number validation ,i.e if mobile number is greater than 8 digits i used to get internal server error in postman and c# code .That was corrected ,but now the vendor doesnt admit any mistake as code works in Postman.
Details (like screenshots):
public void create_user(string token)
{
var options = new RestClientOptions("url")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/create_user_vehical", Method.Post);
request.AddHeader("Authorization", token);
request.AddHeader("Cookie", "session_id=397da3230d3a0f25ea25ed5c552f9e7a455ca436");
request.AlwaysMultipartFormData = true;
request.AddParameter("name", "Tes6754");
request.AddParameter("mobile", "99362655");
request.AddParameter("email", "[email protected]");
request.AddParameter("company", "test");
RestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
}