“Transfer-Encoding: chunked” header in PHP

前端 未结 4 1583
小鲜肉
小鲜肉 2020-12-03 18:40

i want to add Transfer-Encoding: chunked header to the file that i\'m outputing (its just generated plain text), but when i add:

header(\"Transf         


        
4条回答
  •  一整个雨季
    2020-12-03 19:29

    For me when I was trying something with "Transfer-Encoding: chunked" I had to use this code to make it work:

    
    

    This code will still have the "Transfer-Encoding: chunked" header.

    It automatically sets the Transfer-Encoding heading when you use flush but when it set it manually it fails, so to prevent any problems try to remove it. Also make sure that you remove the heading on the line before you do your first flush to prevent errors.

提交回复
热议问题