Master de II. ULL. 1er cuatrimestre. 2020/2021
REST is an acronym that stands for Representational State Transfer.
When an API is RESTful, it is HTTP-based and its resources are identified by their URLs.
Requesting or making a change to a resource comes down to issuing an HTTP request using the particular method that matches your intent.
For example, the HTTP GET method retrieves a resource, and HTTP PUT sends a resource to be saved.
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
~/.../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>
Es una maravilla:
API Gateway es un servicio para la creación, publicación, mantenimiento, monitoreo y protección de API REST, HTTP y WebSocket a cualquier escala.
Un API Gateway es la pieza encargada de unificar la publicación de APIs para que sean consumidas por otras aplicaciones o por los desarrolladores.