4º. 1er cuatrimestre. Itinerario de Sistemas de la Información. Grado en Ingeniería Informática. ULL
API testing requires an application to interact with API. Rest API can be tested with tools like:
Example Using Insomnia
Example Using Postman
Example Using curl
~/.../chapter20-node-js-crguezl/the-http-module(master)]$ curl -d "param1=value1¶m2=value2" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://10.150.22.51:8000/data
<h1>Hello!</h1>
<p>You asked for
<code>
/data
<!-- The url is the full URL without the server, protocol or port. -->
</code>
using the POST method
</p>
<p>Your headers:</p>
<pre>
{
host: '10.150.22.51:8000',
'user-agent': 'curl/7.54.0',
accept: '*/*',
'content-type': 'application/x-www-form-urlencoded',
'content-length': '27'
}
</pre>