Handles POST requests to `/post`.
Echoes back the request’s method, headers, and the parsed JSON body.
Expects a JSON request body.
HTTP Method:
POST
Request Body:
Payload: A generic JSON object.
Responses:
200 OK: Returns a JSON object containing method, headers, and parsed body.400 Bad Request: If the request body is not valid JSON.
Body
application/json
Body
Payload
Request payload wrapper for POST, PUT, PATCH, and DELETE handlers.
This newtype wraps a serde_json::Value to accept arbitrary JSON bodies
in requests that support request bodies.
Response
application/json
Response
Echoes request details
Body
Handles PUT requests to `/put`.
Echoes back the request’s method, headers, and the parsed JSON body.
Expects a JSON request body.
HTTP Method:
PUT
Request Body:
Payload: A generic JSON object.
Responses:
200 OK: Returns a JSON object containing method, headers, and parsed body.400 Bad Request: If the request body is not valid JSON.
Body
application/json
Body
Payload
Request payload wrapper for POST, PUT, PATCH, and DELETE handlers.
This newtype wraps a serde_json::Value to accept arbitrary JSON bodies
in requests that support request bodies.
Response
application/json
Response
Echoes request details
Body
Responds with the HTTP status code specified in the path.
This handler allows testing of how a client handles different HTTP status codes.
It accepts any HTTP method.
Path Parameters:
code: The HTTP status code to return (e.g., 200, 404, 500).
Responses:
- Returns the status code specified by the
codepath parameter. - If an invalid
codeis provided (e.g., not a number or out of valid range),
it defaults to400 Bad Request.
Path Parameters
HTTP status code to return
>= 0
Response
Response
Returns the specified status code
Path Parameters
Returns the User-Agent header from the request.
Extracts and returns the User-Agent header value. Useful for testing
what user agent string your client is sending.
HTTP Method:
GET
Responses:
200 OK: Returns a JSON object containing the User-Agent string.
Response
200 application/json
Response
Returns the User-Agent header
Returns a randomly generated UUID v4.
Generates a new random UUID (Universally Unique Identifier) using the v4 algorithm.
Useful for generating unique identifiers for testing purposes.
HTTP Method:
GET
Responses:
200 OK: Returns a JSON object containing the generated UUID.
Response
200 application/json
Response
Returns a randomly generated UUID