Skip to content

Access Response headers from API calls #176

@allthingsliquid

Description

@allthingsliquid

I recently upgraded to the 7.0.10 version of the package to get TypeScript typing. But I can't find a way to access response headers from API calls, since I only get an object of type ApiResponse.

I need to get access to rate limit information inside my code, and used to be able to do that with the 6.3.0 version:

const remainingRequests = parseInt(response.headers._headers['x-ratelimit-remaining'][0])
const limitRequests = parseInt(response.headers._headers['x-ratelimit-limit'][0])

Is there another way I can have access to this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions