How to send large data using POST method?

前端 未结 3 1000
伪装坚强ぢ
伪装坚强ぢ 2020-12-20 19:33

How do you send large amount of data using POST method?

I heard that post method default is 8M now what if you exceed that size? How would you send a plain text to t

3条回答
  •  失恋的感觉
    2020-12-20 20:15

    A good answer by David:

    The url portion of a request (GET and POST) can be limited by both the browser and the server - generally the safe size is 2KB as there are almost no browsers or servers that use a smaller limit.

    The body of a request (POST) is normally* limited by the server on a byte size basis in order to prevent a type of DoS attack (note that this means character escaping can increase the byte size of the body). The most common server setting is 10MB, though all popular servers allow this to be increased or decreased via a setting file or panel.

    *Some exceptions exist with older cell phone or other small device browsers - in those cases it is more a function of heap space reserved for this purpose on the device then anything else.

    What is the size limit of a post request?

    NOTE: 2MB of data by URL means 2097152 Char in one request.

    Also if you want to send more data you can use multipal ajax request

提交回复
热议问题