{"record":{"id":"4e39795cf0087b33","repo":"eclipse-vertx/vert.x","slug":"414-request-uri-too-long","errorCode":null,"errorMessage":"414 Request-URI Too Long","messagePattern":"414 Request-URI Too Long","errorType":"http","errorClass":null,"httpStatus":414,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java","lineNumber":220,"sourceCode":"  /**\n   * 411 Length Required\n   */\n  HttpResponseExpectation SC_LENGTH_REQUIRED = status(411);\n\n  /**\n   * 412 Precondition Failed\n   */\n  HttpResponseExpectation SC_PRECONDITION_FAILED = status(412);\n\n  /**\n   * 413 Request Entity Too Large\n   */\n  HttpResponseExpectation SC_REQUEST_ENTITY_TOO_LARGE = status(413);\n\n  /**\n   * 414 Request-URI Too Long\n   */\n  HttpResponseExpectation SC_REQUEST_URI_TOO_LONG = status(414);\n\n  /**\n   * 415 Unsupported Media Type\n   */\n  HttpResponseExpectation SC_UNSUPPORTED_MEDIA_TYPE = status(415);\n\n  /**\n   * 416 Requested Range Not Satisfiable\n   */\n  HttpResponseExpectation SC_REQUESTED_RANGE_NOT_SATISFIABLE = status(416);\n\n  /**\n   * 417 Expectation Failed\n   */\n  HttpResponseExpectation SC_EXPECTATION_FAILED = status(417);\n\n  /**\n   * 421 Misdirected Request","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java#L202-L238","documentation":"SC_REQUEST_URI_TOO_LONG is the HttpResponseExpectation constant for HTTP 414 URI Too Long. Vert.x exposes it for response validation; a 414 failing this expectation reports '414 Request-URI Too Long'. The server refuses to process the request because the request target (method + URI + query string) exceeds its configured maximum length.","triggerScenarios":"Building a GET request via Vert.x WebClient with a very long query string (huge filter lists, many IDs, large embedded tokens) so the request line exceeds the server/proxy URI size cap.","commonSituations":"Passing hundreds/thousands of comma-separated IDs as a query parameter, stuffing JWT or signed data into the URL, GET requests generated from large form state, proxies with stricter URI limits than the origin server.","solutions":["Move parameters into the request body: switch to POST with a JSON payload","Batch the parameters (chunk the ID list across multiple requests)","Compress/shorten identifiers (numeric IDs, cursor-based pagination instead of full filter lists)","Use server-side filters: upload a filter spec once, reference it by ID","Raise the URI limit on your own server/proxy only as a last resort"],"exampleFix":"// before\nwebClient.get(url + \"?ids=\" + String.join(\",\", thousandsOfIds)).send(); // 414\n// after\nwebClient.post(url + \"/search\")\n  .sendJsonObject(new JsonObject().put(\"ids\", ids));","handlingStrategy":"validation","validationCode":"// Check request line length before sending\nString uri = path + \"?\" + queryParams;\nif (uri.length() > MAX_URI_LENGTH /* e.g. 8000 */) {\n  switchToPostBodyRequest(params);\n}","typeGuard":"boolean isUriTooLong(Throwable t) {\n  return t instanceof VertxHttpResponseException\n    && ((VertxHttpResponseException) t).getResponse().statusCode() == 414;\n}","tryCatchPattern":"if (isUriTooLong(t)) { convertToPostRequest(params); } else { throw t; }","preventionTips":["Cap query strings at a conservative length (e.g. 2000 chars)","Send large filter lists as a POST body","Use pagination/cursors instead of enumerating items in the URL","Never put large tokens or blobs in the URL"],"tags":["http","uri","query-string","limit"],"backgroundTag":"value-out-of-range","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}