req-res is a lightweight HTTP request and response service to assist frontend devs in visualizing the structure of their requests. This documentation offers an overview of available endpoints and their functionality, catering to various HTTP methods and request types such as GET, POST, PUT, and DELETE.
Perform a health check on the Gentoo server.
- URL: https://mock-api-stkk.onrender.com
- Method: GET
- Status Code: 200 OK
- Body: JSON object containing information about the Gentoo project
Retrieve information about the Gentoo project.
- URL: https://mock-api-stkk.onrender.com/get
- Method: GET
- Status Code: 200 OK
- Body: JSON object containing information about the Gentoo project
Send a POST request to the server.
- URL: https://mock-api-stkk.onrender.com/post
- Method: POST
- Body: Data to be processed by the server
- Status Code: 201 Created
- Body: JSON object containing information about the request
Send a PUT request to the server.
- URL: https://mock-api-stkk.onrender.com/put
- Method: PUT
- Body: Data to be processed by the server
- Status Code: 200 OK
- Body: JSON object containing information about the request
Delete a resource.
- URL: https://mock-api-stkk.onrender.com/delete
- Method: DELETE
- Headers:
- Content-Type: application/json
- Query Parameters:
- id: integer (identifier of the resource)
- message: string (message related to the request)
- Body: JSON data representing the resource to be deleted
- Status Code: 200 OK
- Body: JSON object containing information about the request
{
"message": "Request successfull",
"status_code": "200",
"body_data": {
"key": "value"
},
"queries": {
"id": 123,
"message": "test_message"
},
"headers": [
{
"Content-Type": "application/json"
},
{
"Host": "example.com"
},
{
"User-Agent": "<request user agent header>"
},
{
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
},
// { ... all headers in the request `}
]
}
Thank you for considering contributing to this project! We welcome contributions from the community to help improve the project and make it better for everyone.
- Fork the repository to your GitHub account.
- Clone the forked repository to your local machine.
- Create a new branch for your contribution:
We welcome contributions in the following areas:
- Security disclosures
- Bug fixes
- Feature enhancements
- Documentation improvements
- Code optimizations
- Performance improvements
- Tests
-
Mock Data Generation: Provide tools to generate realistic mock data for responses, including random data generation, predefined templates, and support for complex data structures.
-
Rate Limiting and Throttling: Add support for rate limiting and throttling to prevent abuse and ensure fair usage of the service.
The project started as a way for us to mock endpoints, mostly for testing purposes with my friend @Gee. We wanted to inspect the structure of our requests, including headers, query parameters, and body fields. So, I decided to create this project, and I hope someone finds it helpful too. We still actively use it in our development workflow.