apache/dolphinscheduler · error · RuntimeException

http request method not supported

Error message

http request method %s not supported

What it means

HttpSender.sendHttpRequest builds an OkHttpClient request based on the alert's configured HTTP method. Only GET, POST, PUT (and HEAD via its branch) are handled; any other method configured on the HTTP alert plugin falls through to the default branch and throws this RuntimeException. It is a configuration-level guard, not a transport failure.

Solutions

  1. Edit the HTTP alert instance configuration and set requestType to one of GET, POST, PUT or HEAD.
  2. If DELETE is required, upgrade to a DolphinScheduler version whose HttpSender supports it, or implement a custom alert plugin.
  3. Check for whitespace/case issues in the stored requestType value and normalize it (trim + toUpperCase) before creating the alert.

Example fix

// before: alert instance params
{"requestType": "DELETE"}
// after
{"requestType": "POST"}
Defensive patterns

Strategy: validation

Validate before calling

Set<String> SUPPORTED = Set.of("GET", "POST", "PUT", "HEAD");
if (!SUPPORTED.contains(requestType.trim().toUpperCase())) {
    throw new IllegalArgumentException("requestType must be one of GET/POST/PUT/HEAD: " + requestType);
}

Try / catch

try {
    alertSender.send(alert);
} catch (RuntimeException e) {
    if (e.getMessage().contains("http request method")) {
        log.error("Fix HTTP alert instance requestType: {}", e.getMessage());
    }
}

Prevention

When it happens

Trigger: An HTTP alert plugin instance whose 'requestType' parameter is set to a method other than GET/POST/PUT/HEAD (e.g. DELETE or a typo like 'get ' / 'PATCH') when an alert fires and send() calls sendHttpRequest().

Common situations: Typo in the requestType field when creating the HTTP alert in the UI; version drift where an alert configured for a method the installed plugin version does not support; automated provisioning writing an uppercase/lowercase mismatched method.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/5547893912de9006. Report an issue: GitHub.

Appendix: source

Thrown at dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java:142

        }
    }

    private OkHttpResponse sendHttpRequest(String msg) throws RuntimeException {
        switch (requestType) {
            case POST:
                setMsgInHeader(msg);
                setMsgInRequestBody(msg);
                return sendPostRequest();
            case GET:
                setMsgInUrl(msg);
                setMsgInHeader(msg);
                return sendGetRequest();
            case PUT:
                setMsgInHeader(msg);
                setMsgInRequestBody(msg);
                return sendPutRequest();
            default:
                throw new RuntimeException(String.format("http request method %s not supported",
                        requestType));
        }
    }

    @SneakyThrows
    private OkHttpResponse sendGetRequest() {
        OkHttpRequestHeaders okHttpRequestHeaders = new OkHttpRequestHeaders();
        okHttpRequestHeaders.setHeaders(headerParams);
        okHttpRequestHeaders.setOkHttpRequestHeaderContentType(contentType);
        Map<String, Object> requestParams = new HashMap<>();
        log.info("sending http alert get request, url: {}, header: {}, requestParams: {}, contentType: {}",
                url, headerParams, requestParams, contentType.getValue());
        return OkHttpUtils.get(url, okHttpRequestHeaders,
                requestParams, timeout, timeout, timeout);
    }

    @SneakyThrows
    private OkHttpResponse sendPostRequest() {

View on GitHub (pinned to 02eac45a1b)