ureq icon indicating copy to clipboard operation
ureq copied to clipboard

Response.all does not contain any reference to headers

Open soruh opened this issue 3 years ago • 2 comments

I am using ureq and was trying to get all response headers with a specific name. To look for methods that do this I used the auto-completion of my IDE to look for methods containing the word "header" and did not find all. I propose to create a method on Request and Response called all_headers or headers_all which just calls all internally.

soruh avatar Dec 11 '21 16:12 soruh

This is a "hangover" from ureq being inspired by superagent.

All header related calls are just set, has, all etc (it does avoid "get" since that could be confused with the method). It implicitly means that the only thing being set/has/all etc on requests and responses are headers.

Whether that's a good idea, shrug, that's the background. This could be revised in a future major version bump, in which case we shouldn't just address all, but also has and set.

For now I think we just stay with the API we have, because having multiple calls doing the same thing I think would be more confusing.

algesten avatar Dec 11 '21 18:12 algesten

That seems reasonable, thank you for the quick response

soruh avatar Dec 11 '21 18:12 soruh