request / request-promise

The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.
ISC License
4.77k stars 297 forks source link

How to see the request of a failed request ? #362

Closed kopax closed 3 years ago

kopax commented 3 years ago

I am doing a post request, when it fail, I can not see the headers sent, is there a way to see what where the headers sent?

Thanks for reading.

analog-nico commented 3 years ago

You can achieve this by using the resolveWithFullResponse parameter. Here is a code example.

kopax commented 3 years ago

Thanks ! But does the full response appear in the error ? Anyway, I solved my issue.

analog-nico commented 3 years ago

Yes, the returned errors always contain err.response that includes the headers. Don’t mind the resolveWithFullResponse then. You don’t need it just for the error case.