---
title: "Handles POST requests to `/post`."
url: "https://developer.rucho.org/apis/rucho/versions/5bdf1bcb-8db4-40f1-a293-72c7198e26c8/operations/post_handler"
---

> Full API specification: https://developer.rucho.org/apis/rucho/versions/5bdf1bcb-8db4-40f1-a293-72c7198e26c8.md

# Handles POST requests to `/post`.

`POST` `/post`

Operation ID: `post_handler`

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.

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Echoes request details
- `400` - Invalid JSON payload

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: rucho
  version: 1.6.0
servers:
  - url: https://rucho.org
    description: Production (EKS us-east-2, behind Kong)
paths:
  /post:
    post:
      tags:
        - crate::routes::core_routes
      summary: Handles POST requests to `/post`.
      description: >-
        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.
      operationId: post_handler
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Payload"
        required: true
      responses:
        "200":
          description: Echoes request details
          content:
            application/json:
              schema: {}
        "400":
          description: Invalid JSON payload
components:
  schemas:
    Payload:
      description: |-
        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.
```
