blanket icon indicating copy to clipboard operation
blanket copied to clipboard

Support to access headers from the response

Open diego-cowboy opened this issue 3 years ago • 1 comments

Some API use header to return the current page offset, for example Shopify Rest API

Blanket doesn't provide access to header, it'd be easy to add the headers on the Blanket::Response object here without breaking change https://github.com/inf0rmer/blanket/blob/master/lib/blanket/wrapper.rb#L97

Would you support such improvement ?

diego-cowboy avatar Jan 19 '22 11:01 diego-cowboy

Would also be useful to have the response code available as well.

However, both of these are in-fact breaking changes, since Blanket::Response forwards almost all methods to the parsed response struct, it would break an API with a headers property in the top-level json object., that would no longer work for any such user, thereby breaking their code.

Perhaps the right way to go is to give direct access to the response object, then you can get whatever headers you want from that and I could get the response code from there too.

bisrael avatar Jan 25 '22 14:01 bisrael