REST Protocol
REST Platform
Hoppscotch has a built-in REST platform that can be used to execute REST API requests. The REST platform can be accessed by clicking on the REST
tab in the menu.
The REST platform has the following features:
- Request editor - The request editor can be used to write REST API requests. The editor has syntax highlighting and auto-completion support for REST API requests.
- Collections - The REST platform supports collections. You can save your REST API requests in a collection and execute them later.
- Variables - The REST client supports variables. You can define variables in the REST API request and pass the values of the variables in the variables section.
- Headers - The REST platform supports headers. You can add custom headers to the REST API request.
- Authentication - The REST platform supports authentication. You can add authentication to the REST API request.
- Pre-request scripts - The REST platform supports pre-request scripts. You can write pre-request scripts to modify the request before it is sent to the server.
- Tests - The REST platform supports tests. You can write tests to verify the response of the REST API request.
- Response viewer - The REST platform has a response viewer. You can use the response viewer to view the response of the REST API request.
- Environments - The REST platform supports environments. You can create multiple environments and switch between them.
Representational State Transfer (REST) API is a software interface that enables two systems to communicate on the internet. A REST API can do operations like creating, deleting and modifying data. REST APIs are built on top of the HTTP protocol and have dedicated HTTP methods to perform operations.
REST APIs are stateless, which means that the server does not store any information about the client. This makes REST APIs scalable and easy to maintain.
HTTP Methods
REST APIs use HTTP methods to perform operations. The most common HTTP methods are:
HTTP Method | Usage |
---|---|
GET | Retrieve information about the REST API resource |
POST | Create a REST API resource |
PUT | Update a REST API resource |
DELETE | Delete a REST API resource or related component |
Other methods like HEAD
,CONNECT
, OPTIONS
,TRACE
,PATCH
and other CUSTOM
methods can also be used.
HTTP Status Codes
HTTP status codes are used to indicate the status of the HTTP request. The most common HTTP status codes are:
Status Code | Description |
---|---|
200 | OK |
201 | Created |
204 | No Content |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
405 | Method Not Allowed |
500 | Internal Server Error |
Other status codes like 301
, 302
, 304
, 307
, 308
and other 5XX
codes can also be used.