Sending http headers with python

后端 未结 2 2031
无人共我
无人共我 2021-02-09 06:59

I\'ve set up a little script that should feed a client with html.

import socket

sock = socket.socket()
sock.bind((\'\', 8080))
sock.listen(5)
client, adress = s         


        
2条回答
  •  一生所求
    2021-02-09 07:49

    webob does the dirty http details for you as well

    from webob import Response
    ....
    
    client.send(str(Response("")))
    

提交回复
热议问题