[rabbitmq-discuss] how to get headers from basicproperties list in python?
Anthony Suh
suhprano at gmail.com
Mon Nov 19 18:51:34 GMT 2012
Hello, I'm having trouble retrieving specific values (headers) from the
basicproperties list.
def callback(ch, method, properties, body):
#print " [x] Received %r" % (body,)
f = open('/var/tmp/proto/sc2/delivery/TCG-proto','a+',0)
f.write(body)
f.write('\n')
prop = properties
print prop
#print prop[1]
#print prop[“headers”]
#print prop.headers()
print body
test = raw_input("Enter Something: ")
I tried treating it like a dict or a method, but it errors.
I just want headers, is there a easier way?
Here's the pika doc:
https://pika.readthedocs.org/en/latest/_modules/pika/spec.html#BasicProperties
Sorry I'm both a python and ampq novice. Any feedback or info is greatly
appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121119/ff2382f6/attachment.htm>
More information about the rabbitmq-discuss
mailing list