Today there are a number of online tools to simulate it same as:Postman, Insomnia, Advanced REST, API tester, ... But I will show you about a tool, which can test in localhost and other host.
- With public API
I will take PUBG's API as an example. you can access at : https://developer.playbattlegrounds.com to get documention about this API.
I have finished reading the doc and get api key. Now I will use api test to test this api.
set the header request as required by this api.
Now, press "Send by AJAX" or "Send By SERVER" to send request, and the result:
2. with localhost
The first, I will create a API Post in my localhost by PHP. I need allow access-control-allow-origiin:* in my API, and check POST param.
Now, go to api test to test. fill out URL, choose Method, and add Parameter and click Send by AJAX to test API under localhost.
access http://www.w3webtool.com/api-test để request với api http.
Now, I will test method with IP-API at http://ip-api.com/docs/api:json
I have URL http://ip-api.com/json and method GET to get API by Send By SERVER