hal-client icon indicating copy to clipboard operation
hal-client copied to clipboard

No way access the response headers

Open bubenkoff opened this issue 10 years ago • 4 comments

For example, the application im accessing with this gem, has an application version rendered in custom http header. And it seems, there's no way to access it as response headers are not stored in the representation.

bubenkoff avatar Feb 29 '16 00:02 bubenkoff

Being able to access to response headers would be a great feature. How would you like to access such headers?

pezra avatar Feb 29 '16 03:02 pezra

I'd give the access to whole response object via just an attribute of representation On Feb 29, 2016 04:02, "Peter Williams" [email protected] wrote:

Being able to access to response headers would be a great feature. How would you like to access such headers?

— Reply to this email directly or view it on GitHub https://github.com/pezra/hal-client/issues/50#issuecomment-190014626.

bubenkoff avatar Feb 29 '16 08:02 bubenkoff

I'm leaning against attaching the whole response object. It would couple hal-client much more tighly to the underlying http library. Some http headers are clearly part of the representation. Your custom header and Link headers for example. I am having a harder time finding plausible uses for the rest of the response object. Would a Representation#headers method that returned a hash be acceptable?

pezra avatar Mar 01 '16 14:03 pezra

sure, would work perfrectly for me!

On 1 March 2016 at 15:34, Peter Williams [email protected] wrote:

I'm leaning against attaching the whole response object. It would couple hal-client much more tighly to the underlying http library. Some http headers are clearly part of the representation. Your custom header and Link headers for example. I am having a harder time finding plausible uses for the rest of the response object. Would a Representation#headers method that returned a hash be acceptable?

— Reply to this email directly or view it on GitHub https://github.com/pezra/hal-client/issues/50#issuecomment-190743594.

Anatoly Bubenkov

bubenkoff avatar Mar 01 '16 15:03 bubenkoff