05-17-2018, 07:43 AM
Dean, I was wondering if you or anyone else can help me with this:
##########################################################################################
# FUNCTION sendpost
# INPUT - outpost or inpost
# SENDS AN HTML POST TO CQC MASTER SERVER
# RETURNS - NOTHING
##########################################################################################
#
def sendpost(tosend,param):
        httpServ = httplib.HTTPConnection("10.0.1.8", 17942)
        httpServ.connect()
        if tosend == "outpost":
                httpServ.request('POST', '/VanOutRange?1=%s' % param)
                response = httpServ.getresponse()
        elif tosend == "inpost":
                httpServ.request('POST', '/VanInRange?1=%s' % param)
                response = httpServ.getresponse()
        httpServ.close()
# FUNCTION sendpost END
##########################################################################################
This is python code which sends a post to the CQC Html listener with one parameter. 
The parameter is read by the listener as CQCActParm_2. 
Works fine, but I'd like to send more than one parameter. I can't get the python code to work nor can I find any good examples on the net. 
I've tried various forms of: 
httpServ.request('POST', '/VanOutRange?1=%s' % param)
httpServ.request('POST', '/VanOutRange?1=%s2=%s2' % param % param2)
The latter fails with an error. 
Any idea what the right format might be?
##########################################################################################
# FUNCTION sendpost
# INPUT - outpost or inpost
# SENDS AN HTML POST TO CQC MASTER SERVER
# RETURNS - NOTHING
##########################################################################################
#
def sendpost(tosend,param):
        httpServ = httplib.HTTPConnection("10.0.1.8", 17942)
        httpServ.connect()
        if tosend == "outpost":
                httpServ.request('POST', '/VanOutRange?1=%s' % param)
                response = httpServ.getresponse()
        elif tosend == "inpost":
                httpServ.request('POST', '/VanInRange?1=%s' % param)
                response = httpServ.getresponse()
        httpServ.close()
# FUNCTION sendpost END
##########################################################################################
This is python code which sends a post to the CQC Html listener with one parameter. 
The parameter is read by the listener as CQCActParm_2. 
Works fine, but I'd like to send more than one parameter. I can't get the python code to work nor can I find any good examples on the net. 
I've tried various forms of: 
httpServ.request('POST', '/VanOutRange?1=%s' % param)
httpServ.request('POST', '/VanOutRange?1=%s2=%s2' % param % param2)
The latter fails with an error. 
Any idea what the right format might be?