request-promise-lite icon indicating copy to clipboard operation
request-promise-lite copied to clipboard

Support for statusCode in all responses/response types

Open tfrancois opened this issue 6 years ago • 1 comments

Currently, the library does not return the statusCode as part of the response. It is often beneficial to be able to discern the returned statusCode for an HTTP request even if error has not an occurred. Being able to discern and handle responses that return with a 200 or 204 HTTP status code is particularly useful and currently lacking in successful requests. Of particular interest is when there is no body returned for non-JSON based responses. Without the statusCode, the response is a null body with no other confirmation that the request was successful.

Any way to add support for returning the statusCode for all responses? Thanks in advance.

tfrancois avatar Nov 06 '19 17:11 tfrancois

Agree, it would be helpful. Any ideas on how to add it without breaking the API (of just returning the actual payload)?

laurisvan avatar Nov 23 '19 15:11 laurisvan