Message 107046 - Python tracker (original) (raw)
Hm, there is one issue. The example in the docstring wouldn't work.
You have to get the headers after the body, because the boundary isn't generated until the body has been. So this would work:
body = msg.get_body() headers = dict(msg)
But this won't:
headers = dict(msg) body = msg.get_body()
I'm not sure what the best way to deal with this is. Maybe instead of get_body we should have get_request_data which returns both headers and body. That would provide simpler semantics.
Thoughts?
Thanks, Forest