Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTTP Post
#1
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?
Reply


Messages In This Thread
HTTP Post - by zra - 05-17-2018, 07:43 AM
RE: HTTP Post - by Dean Roddey - 05-17-2018, 09:35 AM
RE: HTTP Post - by zra - 05-17-2018, 09:57 AM
RE: HTTP Post - by zra - 05-17-2018, 09:58 AM
RE: HTTP Post - by Dean Roddey - 05-17-2018, 09:59 AM
RE: HTTP Post - by zra - 05-17-2018, 10:28 AM
RE: HTTP Post - by RichardU - 05-18-2018, 06:14 AM
RE: HTTP Post - by zra - 05-18-2018, 08:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curious About Usage Post Public Domain kblagron 17 1,699 09-24-2021, 09:00 AM
Last Post: Dean Roddey
  Get Field Value via HTTP znelbok 3 1,201 06-11-2020, 03:43 PM
Last Post: Dean Roddey
  HTTP Trigger and Parameters znelbok 1 938 06-11-2020, 03:41 PM
Last Post: Dean Roddey
  HTTP SendPUT simplextech 3 1,479 01-21-2020, 03:05 PM
Last Post: simplextech
  CQC HTTP Events? bjkiller 26 8,513 01-11-2020, 07:27 AM
Last Post: simplextech
  Set value via HTTP Call simplextech 2 1,203 01-07-2020, 04:39 PM
Last Post: simplextech
  HTTP Trigger Driver - see trained URL's? Shaky 1 1,654 09-15-2019, 12:25 PM
Last Post: Dean Roddey
  HTTP Get driver not working znelbok 10 5,279 08-28-2018, 10:10 AM
Last Post: Dean Roddey
  Http Post zra 17 6,984 08-05-2018, 01:55 PM
Last Post: zra
  IFTT and HTTP Trigger parameter passing setup Shaky 5 4,519 03-09-2018, 10:20 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)