Return the RateLimiting headers in metadata
lucianolxp opened this issue · 2 comments
lucianolxp commented
with the rewrite in version 10 the feature of #27 was lost
currently the headers information is never returned: just the response body is parsed and _response.headers
is ignored, for example:
we would like to write a backoff strategy for our application but it is not possible to do so with the current version of the sdk
siirimangus commented
Hey,
one possibility to get the headers, is to pass a callback function with three parameters to the request. The third parameter will include http context and you can extract the response headers from there. For example something like this:
const deals = await pipedrive.DealsController.getAllDeals(
{start: 0, limit: 5},
(error, response, context) => console.log('response headers', context.response.headers)
);
Would it work for you?
lucianolxp commented
Yes, that worked, thank you so much!