{"record":{"id":"c4a21498fdc591f0","repo":"quarkusio/quarkus","slug":"no-post-data-c4a214","errorCode":null,"errorMessage":"No post data","messagePattern":"No post data","errorType":"http","errorClass":"RuntimeException","httpStatus":500,"severity":"error","filePath":"integration-tests/elytron-resteasy-reactive/src/main/java/io/quarkus/it/resteasy/reactive/elytron/RootResource.java","lineNumber":30,"sourceCode":"import jakarta.ws.rs.Produces;\nimport jakarta.ws.rs.core.Context;\nimport jakarta.ws.rs.core.MediaType;\nimport jakarta.ws.rs.core.SecurityContext;\n\nimport io.quarkus.security.Authenticated;\nimport io.quarkus.security.PermissionsAllowed;\nimport io.quarkus.security.identity.SecurityIdentity;\n\n@Path(\"/\")\npublic class RootResource {\n    @Inject\n    SecurityIdentity identity;\n\n    @POST\n    @Consumes(MediaType.TEXT_PLAIN)\n    public String posts(String data, @Context SecurityContext sec) {\n        if (data == null) {\n            throw new RuntimeException(\"No post data\");\n        }\n        if (sec.getUserPrincipal().getName() == null) {\n            throw new RuntimeException(\"Failed to get user principal\");\n        }\n        return \"post success\";\n    }\n\n    @GET\n    @Produces(MediaType.TEXT_PLAIN)\n    public String approval(@Context SecurityContext sec) {\n        if (sec.getUserPrincipal().getName() == null) {\n            throw new RuntimeException(\"Failed to get user principal\");\n        }\n        return \"get success\";\n    }\n\n    @GET\n    @Path(\"/secure\")","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/elytron-resteasy-reactive/src/main/java/io/quarkus/it/resteasy/reactive/elytron/RootResource.java#L12-L48","documentation":"Sentinel RuntimeException thrown by RootResource.posts() in the elytón-resteasy-reactive integration test. It fires when the @POST endpoint receives a null body even though it declares @Consumes(TEXT_PLAIN). It is the test's way of failing fast when request payload propagation to a JAX-RS method parameter breaks.","triggerScenarios":"POST with @Consumes(TEXT_PLAIN) where the request body arrives as null — empty body, missing Content-Type matching TEXT_PLAIN, or content that the reader fails to decode into the String parameter.","commonSituations":"Test/client sending POST without a body; wrong Content-Type header (e.g. application/json) so no text body is bound; proxy or client stripping the payload.","solutions":["Send a non-empty plain-text body with Content-Type: text/plain","Ensure the client sends the payload as the request entity (e.g. curl -d 'data'), not as a query param","Verify the endpoint method signature binds the body to the first String parameter","Check no filter/interceptor consumes or clears the request entity stream"],"exampleFix":"// before\ncurl -X POST http://localhost:8080/api -H 'Content-Type: text/plain'\n// after\ncurl -X POST http://localhost:8080/api -H 'Content-Type: text/plain' -d 'hello'","handlingStrategy":"validation","validationCode":"if (data == null || data.isBlank()) {\n    throw new BadRequestException(\"Request body must be non-empty text/plain\");\n}","typeGuard":"boolean hasBody(String data) {\n    return data != null && !data.isBlank();\n}","tryCatchPattern":"try {\n    process(data);\n} catch (RuntimeException e) {\n    throw new BadRequestException(\"Missing or unreadable POST body\", e);\n}","preventionTips":["Always send Content-Type: text/plain with a non-empty body","Send payload as entity body, not query parameters","Add client-side checks that the body is non-empty before POSTing"],"tags":["resteasy-reactive","request-body","post"],"backgroundTag":"missing-request-body","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}