Adding methods afterResponseHeaders and afterJSONWithResponseHeaders to get the response headers.