Replicating POST request in POSTMAN

Viewed 38

I'm trying to use Postman and replicate the following POST request from this link:

https://www.msc.com/en/track-a-shipment?params=dHJhY2tpbmdOdW1iZXI9YXNkYSZ0cmFja2luZ01vZGU9MA%3D%3D

The payload necessary to get a response from this API is something like:

{trackingNumber: "asda", trackingMode: "0"}

With the following payload, I expect to receive the following response:

{IsSuccess: false, Data: "Container not found"}

Here, you can see my Postman request:

request

headers

All I seem to get from this is an empty string, which is not the same result I would see If I checked my Network tab from developer tools.

I'm wondering what do I need to do in order to get the same result. Change headers? Change payload format? What else could it be?

1 Answers

The request works for me, what's the difference that depends. But the easiest way to find the correct answer is to import the request as is from the Developer Tools.

  1. Find the request on the request list and click Copy as cURL (bash):

enter image description here

  1. Then on Postman click Import (top left main window) and select the Raw Text option:

enter image description here

The request will be on the current window and you can just click Send:

enter image description here

So you can now diff your request with this one. There's a lot of headers so I would remove them one by one and see where the request fails. Without having the API at hand, this is really a trial-and-error exercise.

Hope this helps.

Related