python变量名长度有限制吗_url长度有限制么?
url長度有限制么?
首先明確一點,http協議里并沒有對url的長度做任何限制,協議里只是規定url因太長導致服務器無法處理時,服務器應該返回414狀態碼。
2014年,IETF對http協議進行了更新,將RFC2616拆分為6個單獨的協議說明,在RFC 7230的3.1.1章節中有如下表述:
HTTP does not place a predefined limit on the length of a request-line, as described in Section 2.5. A server that receives a method longer than any that it implements SHOULD respond with a 501(Not Implemented) status code. A server that receives a request-target longer than any URI it wishes to parse MUST respond with a 414 (URI Too Long) status code (see Section?6.5.12 of [RFC7231]).
那么為什么總有一個url有長度限制的印象呢?你的印象其實是瀏覽器和服務器造成的。
下表是各種瀏覽器對url長度的限制說明,數據很老了
瀏覽器
長度限制
IE
2083
firefox
65536
chrome
8182
Safari
80000
Opera
190000
下表是各服務器對url的長度限制
服務器
長度限制
Apache
8192
IIS
16384
ngnix
client_header_buffer_size參數為請求頭分配一個緩沖區,默認1k,可修改
總結
以上是生活随笔為你收集整理的python变量名长度有限制吗_url长度有限制么?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OpenCV——图像二值化
- 下一篇: python网格搜索核函数_python