String modifying error, trying to delete data in string

mikie peter.byaruhanga at utamu.ac.ug
Mon Mar 24 17:20:26 CET 2014


Here is some code:
       import socket,sys

       s=socket.socket()
       port=int(sys.argv[1]) 
       s.bind(("127.0.0.1",port))
       s.listen(2) 
       cls,addr=s.accept()

       data=cls.recv(1024)
       f=data.pop("Proxy-Connection")
       cls.close()

Im trying to delete some headers in the request but get an error saying:
'str' object has no attribute 'pop'

How can I modify data received from the client?



More information about the Python-list mailing list