0

I try to move my text analyzer from console to web form.

I have simple form like this:

<form action="/">
  <textarea name="str"></textarea>
  <input type="submit">
</form>

Generally I could have very long texts for analysis inside of textarea. When I submit the form I get the following from thin:

Invalid request: Header longer than allowed

So the question is what is the proper approach to send long texts to server? Uploading files or filling links to url are not the option unfortunately.

Mikhail Chuprynski
  • 2,404
  • 2
  • 29
  • 42

1 Answers1

3

By default the method of a form is GET, which has a limit on the number of characters allowed. (The limit depends on server and client, see for instance this answer, which specifies that usually it is 8KB).

You should use instead a method POST, which has much larger limit, around 2GB.

<form action="/" method="POST">
  <textarea name="str"></textarea>
  <input type="submit">
</form>
Community
  • 1
  • 1
Renzo
  • 26,848
  • 5
  • 49
  • 61