Rest Api Hit Difference B/w Browser and Postman

surender kumar :

I am calling a REST API using postman and a Browser. Each gives me the same result but, I need know the how to identify which requests come from postman and which come from a browser. I need to stop hits from Postman.

DanteTheSmith :

Add an additional identifier to Postman request - like Header.

Under Headers tab in Postman, click under New Key and write some name like myFlag, then under Value part set something like "postman"

You can pass other useful data in this manner. And for some servers you will need to setup stuff before you can use them, for example authorization tokens etc..

Now on the backend side (in part of code where you handle request for API in question) you should be able to read all headers including the one we added. Say if this one is present it's a postman open a new block with empty line or console block in it and set breakpoint to that line

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=469632&siteId=1