documentation/protocols/rest.mdx
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:
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.
Hoppscotch's REST API platform provides you with a fast and seamless experience to test and debug your API endpoints.
It's primarily divided into two sections along with other features to help you build better APIs.
The request section provides you the capability to define your API endpoint and initiate the communication.
You can select from a range of HTTP methods such as GET, POST, PUT etc. You can read more about HTTP methods in RESTful protocol.
You can also add dynamic behaviors to your requests by specifying Headers, Request Body, Authorization Headers, Parameters, and Pre-request scripts.
Hoppscotch also provides the capability to run Tests on the responses you receive.
This is where you see the responses to your API endpoints. You can download and copy the returned responses for further use.
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 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.
The REST API platform also houses other features like: