MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
940 stars 279 forks source link

Access headers on a request? #556

Closed ozzyonfire closed 1 year ago

ozzyonfire commented 1 year ago

Is there any way of accessing the headers of the request?

I know if a request fails, we can see stuff in the error.response object, but this is on a successful request.

I'm having some API related issues and needed to pull the X-Request-ID header for my request.

Thanks!

sekretov commented 1 year ago

++ or request header deprecated calls

lpinca commented 1 year ago

Is there any way of accessing the headers of the request?

No, there is not. The client always adds the same headers to the request. The X-Request-ID header is not added by the client.

ozzyonfire commented 1 year ago

True. Sorry - I think I misspoke.

I actually meant accessing the headers of the response.

I thought there may be a similar mechanism to the way we get api limits back (i.e. an event on the api object) but for accessing headers.

lpinca commented 1 year ago

At the moment there is no way. We could add a 'response' event but only if there is demand for it. In the meanwhile you can add the feature in a fork and use it if you really need it.

LouiseEH commented 1 year ago

It would be great being able to access the x-request-id as Shopify asks for it when reporting bugs