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.
Launch the Postman API tool. Add the Rest API endpoint using the box URL in the Postman tool. Choose the method: GET to execute the get method. Get requests do not need a request body. enter the value in the Value text box as shown in the picture. Click on the Send button to execute the API call.
POSTMAN is the best tool for performing POST and GET operations. Send a request and get a response in POSTMAN Client: For testing purpose, we use the API’s provided here. Check each CRUD call in the POSTMAN client using the API’s provided by the dummy site.
How to Download POSTMAN Client? POSTMAN is an API client used to develop, test, share and document APIs. It is used for backend testing where we enter the end-point URL, it sends the request to the server and receives the response back from the server. The same thing can be accomplished through API Templates like Swagger as well.
Other clients are also available like SOAP UI which is a REST and SOAP client, advanced REST clients like JMeter can call the APIs directly from the browser. POSTMAN is the best tool for performing POST and GET operations. Send a request and get a response in POSTMAN Client: For testing purpose, we use the API’s provided here.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With