Maximum length of HTTP GET request

前端 未结 7 1988
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-21 05:24

What\'s the maximum length of an HTTP GET request?

Is there a response error defined that the server can/should return if it receives a GET request that exceeds this

7条回答
  •  [愿得一人]
    2020-11-21 05:26

    You are asking two separate questions here:

    What's the maximum length of an HTTP GET request?

    As already mentioned, HTTP itself doesn't impose any hard-coded limit on request length; but browsers have limits ranging on the 2 KB - 8 KB (255 bytes if we count very old browsers).

    Is there a response error defined that the server can/should return if it receives a GET request exceeds this length?

    That's the one nobody has answered.

    HTTP 1.1 defines status code 414 Request-URI Too Long for the cases where a server-defined limit is reached. You can see further details on RFC 2616.

    For the case of client-defined limits, there isn't any sense on the server returning something, because the server won't receive the request at all.

提交回复
热议问题