Skip to content
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

Support to access headers from the response #40

Open
diego-cowboy opened this issue Jan 19, 2022 · 1 comment
Open

Support to access headers from the response #40

diego-cowboy opened this issue Jan 19, 2022 · 1 comment

Comments

@diego-cowboy
Copy link

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 ?

@bisrael
Copy link

bisrael commented Jan 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants