Exposing the actual Response object after a successful fetch would add unlimited flexibility to handling the response outside of the body(e.g. response headers as we talked about on Gitter @RWOverdijk ).
Maybe we can change the request(method: string, path: string, body?: {}, options?: {}): Promise<any|Error> signature to request(method: string, path: string, body?: {}, options?: {}, responseOutput?: { response: Response}): Promise<any|Error> and all wrapper functions that use it?
Exposing the actual Response object after a successful
fetch
would add unlimited flexibility to handling the response outside of the body(e.g. response headers as we talked about on Gitter @RWOverdijk ).Maybe we can change the
request(method: string, path: string, body?: {}, options?: {}): Promise<any|Error>
signature torequest(method: string, path: string, body?: {}, options?: {}, responseOutput?: { response: Response}): Promise<any|Error>
and all wrapper functions that use it?so the impl would be something like: