Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def post_data(host, port, queuename):
try:
params = urllib.urlencode({"queue":queuename, "value":json.dumps(simplemonitor.get_all_values())})
request = urllib2.Request("http://%s:%s" % (host, str(port)), params)
f = urllib2.urlopen(request)
response = f.read()
f.close()
except urllib2.URLError, err:
print err
else:
print "MQ Response: %s" % response