Hi,
I have a script client.py as:
Server.py:
------------------------------
I got the malformed header from script. Bad header=200: error.
I want to read the posted data from Client.py in Server.py. How do i get the parameter value from the url. Kindly help me.
I have a script client.py as:
Code:
import httplib
http = httplib.HTTP("localhost:8081")
data="Welcome to My Page"
http.putrequest("POST", "/cgi-bin/server.py?id="+data)
http.putheader("Host", "localhost:8081")
http.putheader("Content-Type", 'text/plain')
http.putheader("Content-Length", str(len(data)))
http.endheaders()
http.send(data)
Code:
import httplib import cgi print "Content-Type:text/plain" print id=cgi.FieldStorage() print id
I got the malformed header from script. Bad header=200: error.
I want to read the posted data from Client.py in Server.py. How do i get the parameter value from the url. Kindly help me.
Comment