Home > Back-end >  Get desired result while calling API using Postman but don't when using RestShart in console pr
Get desired result while calling API using Postman but don't when using RestShart in console pr

Time:10-05

We are working on a project where our C# appliction is using 3rd party API (and we can't ask 3rd party for any changes). We are facing very strange behaviour that there is one end-point which requires few headers including 'date', when we call it through Postman it works fine and gives desired result but when we call it from a console program using RestSharp code (copied from Postman), the API returns with date format error showing the date in different format than what we send in the request. Please find below snapshots for further explaination:

1: Successful call from Postman:

enter image description here

2: Copied code from Postman in C# console program:

enter image description here

3: Date format error while calling from console program enter image description here

Your expert opinion will be highly appreciated.

CodePudding user response:

Finally i got the solution enter image description here

  • Related