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

Retrieve response headers from gocardless #62

Open
matt-fidd opened this issue Aug 16, 2024 · 0 comments
Open

Retrieve response headers from gocardless #62

matt-fidd opened this issue Aug 16, 2024 · 0 comments

Comments

@matt-fidd
Copy link

Is your feature request related to a problem? Please describe.
With the impending rate limit changes, there will be no way to fetch data from the new informational headers.

    HTTP_X_RATELIMIT_LIMIT: Indicates the maximum number of allowed requests within the defined time window.
    HTTP_X_RATELIMIT_REMAINING: Shows the number of remaining requests you can make in the current time window.
    HTTP_X_RATELIMIT_RESET: Provides the time remaining in the current window.
    HTTP_X_RATELIMIT_ACCOUNT_SUCCESS_LIMIT: Indicates the maximum number of allowed requests within the defined time window.
    HTTP_X_RATELIMIT_ACCOUNT_SUCCESS_REMAINING: Shows the number of remaining requests you can make in the current time window.
    HTTP_X_RATELIMIT_ACCOUNT_SUCCESS_RESET: Provides the time remaining in the current window.

Describe the solution you'd like
A way to retrieve the response headers along with the data when using the API.

Below are a couple of ideas I've had as to how this could be implemented:

return response.data;

becomes:

without breaking change:

return {
  ...response.data,
  headers: response.headers,
}

with breaking change:

return {
  data: response.data,
  headers: response.headers,
}
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

1 participant