Leantime/leantime · error · MissingParameterException

Could not get JSON from body or form fields

Error message

Could not get JSON from body or form fields

What it means

Error "Could not get JSON from body or form fields" thrown in Leantime/leantime.

Source

Thrown at app/Domain/Api/Controllers/Jsonrpc.php:141

    private function getJsonFromBody(): array
    {

        if ($this->incomingRequest->server('REQUEST_METHOD') === 'POST'
            && empty($_POST)
            && $this->incomingRequest->getContent() !== null
            && $this->incomingRequest->getContent() !== false
            && $this->incomingRequest->getContent() !== '') {

            $bodyContent = json_decode(
                json: $this->incomingRequest->getContent(),
                associative: true,
                flags: JSON_THROW_ON_ERROR
            );

            return $bodyContent;
        }

        throw new MissingParameterException('Could not get JSON from body or form fields');
    }

    /**
     * Handles patch requests
     */
    public function patch(): Response
    {
        return $this->returnInvalidRequest('The JSON-RPC API only supports POST/GET requests');
    }

    /**
     * Handles delete requests
     */
    public function delete(): Response
    {
        return $this->returnInvalidRequest('The JSON-RPC API only supports POST/GET requests');
    }

View on GitHub (pinned to 9a9f49f100)

When it happens

Trigger: Thrown at app/Domain/Api/Controllers/Jsonrpc.php:141 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Leantime/leantime@9a9f49f100 (2026-08-21). Data as JSON: /api/errors/6e615163bbd7fada. Report an issue: GitHub.