用stream.read_to_end是不行的,tcpstream不是文件沒有明確的結束符
需要先讀取http header節,再找Content-Length header,然后讀取body。

這是http請求的結構
有個github可以參考,地址是https://github.com/ltheinrich/lhi
用stream.read_to_end是不行的,tcpstream不是文件沒有明確的結束符
需要先讀取http header節,再找Content-Length header,然后讀取body。

這是http請求的結構
有個github可以參考,地址是https://github.com/ltheinrich/lhi
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。