import httplib, urlparse conn = httplib.HTTPConnection("localhost:9095") conn.request("HEAD", "/queues/jms.queue.orders") res = conn.getresponse() createLink = res.getheader("msg-create") print createLink conn.close() createParsed = urlparse.urlparse(createLink) conn = httplib.HTTPConnection(createParsed.netloc) headers = {'Content-Type' : 'application/xml'} xml = """ Bill $199.99 iPhone4 """ conn.request("POST", createParsed.path, xml, headers) res = conn.getresponse() print res.status, res.reason