Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rest Api Hit Difference B/w Browser and Postman

Tags:

java

rest

http

api

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.

like image 938
surender kumar Avatar asked Nov 15 '17 15:11

surender kumar


People also ask

How to use postman API with REST API?

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.

How to perform post and get operations using postman?

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.

What is postman client?

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.

Which is the best REST API client in JMeter?

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.


1 Answers

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

like image 150
DanteTheSmith Avatar answered Oct 18 '22 02:10

DanteTheSmith