New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An accessor for the whole headers, as sent #77
Conversation
Thanks aredridel, that's pretty much identical to the code I wrote yesterday :-) |
I'm not sure about the function name though. "header" most of the time refers to a single key/value pair, so I think it should be sth. like get_headers_encoded() or get_headerblock_encoded(). |
Whoops! Typo in my PR: I named it |
My initial preference was to call this Alternatively, we could instead have this new API be a "split" type of API and return a tuple of |
What I'd really love is objects returned with a lifetime tied to the input, that themselves contain the ref, and have methods for further parsing — much like |
Ah indeed, that does sound pretty nice. A To start with we can just create the |
I like it as well, sounds like a clean approach and should not be too much work to implement! |
Obsoleted by 40c687b. Thanks all! |
Reading the source, this naming makes sense — encoded meaning "as sent", raw meaning "before character set changes"; without looking at the source, I find it a bit inscrutable. I've matched the naming of
get_body_encoded()
when implementingget_heades_encoded()
as mentioned in #75.It might be worth clarifying some of this naming if there's a major version bump, but I hope this is acceptable as it is for now.