I try to create an application in web2py
framework. By default web2py
server has Transfer-Encoding: Chunked
header for response, but in that case when target remote web application sends GET request to my app it could get only first string of text from requested page (from file's content that displayed on page). If to use Content-Length
instead, for example, with value of 1000 it will get 1000 bytes of data from page... But if I expect to response with huge range of data, how to set Content-Length
parameter to infinity or by file (like here but with web2py
syntax instead of php
)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If you are serving web2py via the built-in development server and serving files via the Expose
functionality, then the files will be served via chunked transfer encoding.
However, if you instead use response.stream
to serve files, the Content-Length header will be set automatically.