Sunday, September 2, 2018

Test HTTP Request Method Online under localhost or other host (Simulate API)

The HyperText Transfer Protocol (HTTP) is a client-server protocol powering most of World Wide Web. Every time you surf the web, your browser is sending HTTP request messages for HTML pages, images, scripts, and styles sheets. Web servers handle these requests by returning response messages containing the requested resource, completing the HTTP request-response cycle.

http request function



HTTP Request Methods contain 9 type of request, the most common are GET and POST method.


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 (some tools do not support).


The first, I will create a API Post in my localhost by PHP.

The first, I need allow access-control-allow-origiin:* in my API, and check POST param.

My File PHP


Now, go to https://w3webtool.com/http-request-method to test. fill out URL, choose Method, and add Parameter and click Send by CLIENT to test API under localhost.

POST param method to localhost
You also can add Authentication or any Header to test your HTTP Request.

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

get Function

You can try with your API now. Hope it useful for you.