{"record":{"id":"6e615163bbd7fada","repo":"Leantime/leantime","slug":"could-not-get-json-from-body-or-form-fields","errorCode":null,"errorMessage":"Could not get JSON from body or form fields","messagePattern":"Could not get JSON from body or form fields","errorType":"http","errorClass":"MissingParameterException","httpStatus":400,"severity":"error","filePath":"app/Domain/Api/Controllers/Jsonrpc.php","lineNumber":141,"sourceCode":"    private function getJsonFromBody(): array\n    {\n\n        if ($this->incomingRequest->server('REQUEST_METHOD') === 'POST'\n            && empty($_POST)\n            && $this->incomingRequest->getContent() !== null\n            && $this->incomingRequest->getContent() !== false\n            && $this->incomingRequest->getContent() !== '') {\n\n            $bodyContent = json_decode(\n                json: $this->incomingRequest->getContent(),\n                associative: true,\n                flags: JSON_THROW_ON_ERROR\n            );\n\n            return $bodyContent;\n        }\n\n        throw new MissingParameterException('Could not get JSON from body or form fields');\n    }\n\n    /**\n     * Handles patch requests\n     */\n    public function patch(): Response\n    {\n        return $this->returnInvalidRequest('The JSON-RPC API only supports POST/GET requests');\n    }\n\n    /**\n     * Handles delete requests\n     */\n    public function delete(): Response\n    {\n        return $this->returnInvalidRequest('The JSON-RPC API only supports POST/GET requests');\n    }\n","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Api/Controllers/Jsonrpc.php#L123-L159","documentation":"Error \"Could not get JSON from body or form fields\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Api/Controllers/Jsonrpc.php:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}