5

I'm using Flask with Apache. When I send a GET request with a long url (19000+ characters), the response is

Status 414: Request-URI Too Large. 

I suspect that the request triggers a werkzeug RequestURITooLarge Exception or a flask HTTPException. When I send a request with similar url length to Apache directly there is no error.

Is there a way to increase the maximum url length that Flask handles?

codegeek
  • 32,236
  • 12
  • 63
  • 63
mmcb
  • 73
  • 1
  • 1
  • 4
  • ¿Can you use post data to get the page? – Ricardo Feb 25 '14 at 23:28
  • Yes, I could use a POST request. However, I want to know if a GET request is possible. For my application, the request does not create any side effects on the server, so I'd prefer to use a GET. – mmcb Feb 25 '14 at 23:41
  • Do you know that Apache isn't triggering the error? – dirn Feb 25 '14 at 23:43

1 Answers1

7

You can use POST instead of GET, but if you don't need to use it i think this question have related answer for your problem.

How do I resolve a HTTP 414 "Request URI too long" error?

Community
  • 1
  • 1
  • Ok, the error was with Apache. I exceeded the default HTTP request-line limit of 8190 bytes. Following the advice in the question referenced above, I changed the Apache LimitRequestLine configuration directive, and that solves the issue. I can now support long urls. – mmcb Feb 26 '14 at 00:40
  • great, but also try to use POST because you may forget to make this configuration in the deployment process :) – Mohamed Abd El Raouf Feb 26 '14 at 00:43