Skip to content

Retrieve response headers from gocardless #62

@matt-fidd

Description

@matt-fidd

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,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions