Python TPCServer rfile.read blocks

前端 未结 1 1798
陌清茗
陌清茗 2021-02-14 22:33

I am writing a simple SocketServer.TCPServer request handler (StreamRequestHandler) that will capture the request, along with the headers and the messa

1条回答
  •  礼貌的吻别
    2021-02-14 23:30

    Keith's comment is correct. Here's what it looks like

         length = int(self.headers.getheader('content-length'))
         data = self.rfile.read(length)
    

    0 讨论(0)
提交回复
热议问题