languagetool-org/languagetool · warning · BadRequestException

This is the LanguageTool API. You have not specified any par

Error message

This is the LanguageTool API. You have not specified any parameters. Please see 

What it means

Fallback error thrown for any recognized path that is neither '/', '/favicon.ico', nor contains '/v2/'. It indicates a request to the LanguageTool API with no parameters and no valid endpoint, distinct from the root-path case.

Source

Thrown at languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java:223

        return;
      }
      if (allowedIps == null || allowedIps.contains(origAddress)) {
        if (path.startsWith("/v2/")) {
          ApiV2 apiV2 = new ApiV2(textCheckerV2, config.getAllowOriginUrl());
          String pathWithoutVersion = path.substring("/v2/".length());
          final Map<String, String> finalParameters = parameters;
          final String finalRemoteAddress = remoteAddress;
          TelemetryProvider.INSTANCE.createSpan("/v2", Attributes.empty(), () -> apiV2.handleRequest(pathWithoutVersion, httpExchange, finalParameters, errorRequestLimiter, finalRemoteAddress, config));
        } else if (path.endsWith("/Languages")) {
          throw new BadRequestException("You're using an old version of our API that's not supported anymore. Please see " + API_DOC_URL);
        } else if (path.equals("/")) {
          throw new BadRequestException("Missing arguments for LanguageTool API. Please see " + API_DOC_URL);
        } else if (path.contains("/v2/")) {
          throw new BadRequestException("You have '/v2/' in your path, but not at the root. Try an URL like 'http://server/v2/...' ");
        } else if (path.equals("/favicon.ico")) {
          sendError(httpExchange, HttpURLConnection.HTTP_NOT_FOUND, "Not found");
        } else {
          throw new BadRequestException("This is the LanguageTool API. You have not specified any parameters. Please see " + API_DOC_URL);
        }
      } else {
        String errorMessage = "Error: Access from " + StringTools.escapeXML(origAddress) + " denied";
        sendError(httpExchange, HttpURLConnection.HTTP_FORBIDDEN, errorMessage);
        throw new RuntimeException(errorMessage);
      }
    } catch (Exception e) {
      String response;
      int errorCode;
      boolean textLoggingAllowed = false;
      boolean logStacktrace = true;
      Throwable rootCause = ExceptionUtils.getRootCause(e);
      if (e instanceof TextTooLongException || rootCause instanceof TextTooLongException) {
        errorCode = HttpURLConnection.HTTP_ENTITY_TOO_LARGE;
        response = e.getMessage();
        logStacktrace = false;
      } else if (e instanceof ErrorRateTooHighException || rootCause instanceof ErrorRateTooHighException) {
        errorCode = HttpURLConnection.HTTP_BAD_REQUEST;

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Use POST /v2/check with text and language parameters
  2. Fix the endpoint URL to include the /v2/ prefix and endpoint name
  3. Check for URL typos or truncated configuration values in the client

Example fix

// before
curl http://localhost:8081/check?text=hi
// after
curl -X POST http://localhost:8081/v2/check -d 'text=hi&language=en-US'
Defensive patterns

Strategy: validation

Validate before calling

const p = new URL(endpoint).pathname;
if (!p.startsWith('/v2/')) throw new Error(`Endpoint must be /v2/<name>, got '${p}'`);

Prevention

When it happens

Trigger: Requests to paths like '/check' (missing version), '/v2' (no trailing slash/endpoint), or any unrecognized path on the server.

Common situations: Older client integrations pointing at the pre-/v2 API, typos in endpoint URLs, health-check probes hitting arbitrary paths.

Understand the failure class

Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.

Related errors


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/01a3390b978db098. Report an issue: GitHub.