{"record":{"id":"ad9cb1c48b7c96bb","repo":"flowable/flowable-engine","slug":"http-task-request-method-invalid","errorCode":null,"errorMessage":"HTTP_TASK_REQUEST_METHOD_INVALID","messagePattern":"HTTP_TASK_REQUEST_METHOD_INVALID","errorType":"validation","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java","lineNumber":253,"sourceCode":"        });\n    }\n\n    // HttpRequest validation\n\n    protected void validateRequest(HttpRequest request) throws FlowableException {\n        if (request.getMethod() == null) {\n            throw new FlowableException(HTTP_TASK_REQUEST_METHOD_REQUIRED);\n        }\n\n        switch (request.getMethod()) {\n            case \"GET\":\n            case \"POST\":\n            case \"PUT\":\n            case \"PATCH\":\n            case \"DELETE\":\n                break;\n            default:\n                throw new FlowableException(HTTP_TASK_REQUEST_METHOD_INVALID);\n        }\n\n        if (request.getUrl() == null) {\n            throw new FlowableException(HTTP_TASK_REQUEST_URL_REQUIRED);\n        }\n    }\n    protected HttpHeaders getRequestHeaders(VariableContainer variableContainer) {\n        return parseRequestHeaders(variableContainer, requestHeaders, HTTP_TASK_REQUEST_HEADERS_INVALID);\n    }\n\n    protected HttpHeaders getRequestSecureHeaders(VariableContainer variableContainer) {\n        return parseRequestHeaders(variableContainer, requestSecureHeaders, HTTP_TASK_REQUEST_SECURE_HEADERS_INVALID);\n    }\n\n    protected HttpHeaders parseRequestHeaders(VariableContainer variableContainer, Expression headers, String errorPrefix) {\n        try {\n            String headersString = ExpressionUtils.getStringFromField(headers, variableContainer);\n            return HttpHeaders.parseFromString(headersString);","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java#L235-L271","documentation":"validateRequest only accepts the methods GET, POST, PUT, PATCH and DELETE; any other method string throws FlowableException(HTTP_TASK_REQUEST_METHOD_INVALID). The delegate deliberately restricts the HTTP verb set supported by Flowable HTTP tasks.","triggerScenarios":"An HTTP task or programmatically built HttpRequest has a method set to a value outside {GET, POST, PUT, PATCH, DELETE} — e.g. HEAD, OPTIONS, TRACE, lowercase \"get\", or a typo like \"GTE\".","commonSituations":"Typos in the requestMethod field; lowercase method names from variables or templates; attempting to use HEAD/OPTIONS which the delegate does not support; expression/variable injection supplying an unexpected value.","solutions":["Change the request method to one of GET, POST, PUT, PATCH or DELETE (exact uppercase spelling).","If you need HEAD/OPTIONS, implement a custom delegate or use a different client, since these verbs are not supported by the built-in HTTP task.","Normalize/uppercase any variable-driven method value before it reaches the request."],"exampleFix":"// before\nrequest.setMethod(\"get\"); // invalid\n\n// after\nrequest.setMethod(\"GET\");","handlingStrategy":"validation","validationCode":"Set<String> ALLOWED = Set.of(\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\");\nif (request.getMethod() != null && !ALLOWED.contains(request.getMethod())) {\n    throw new IllegalArgumentException(\"Unsupported method: \" + request.getMethod());\n}","typeGuard":"boolean isSupportedHttpMethod(String m) {\n    return \"GET\".equals(m) || \"POST\".equals(m) || \"PUT\".equals(m)\n        || \"PATCH\".equals(m) || \"DELETE\".equals(m);\n}","tryCatchPattern":"try {\n    delegate.execute(execution);\n} catch (FlowableException e) {\n    if (\"HTTP_TASK_REQUEST_METHOD_INVALID\".equals(e.getMessage())) {\n        // correct the method value in the task configuration\n    }\n}","preventionTips":["Use only GET, POST, PUT, PATCH, DELETE in exact uppercase","Uppercase/trim variable-driven method values before injecting them","Do not attempt HEAD/OPTIONS with the built-in HTTP task; use a custom delegate","Validate request method fields at deploy time, not just runtime"],"tags":["http","validation","invalid-enum","http-task"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}