Commit b2bce681 b2bce681628c8409b8a59545c5dc645bc1882ef3 by Nicolas Perriault

added casper.currentResponse to access latest received response object

1 parent 39b5e4ce
......@@ -111,6 +111,7 @@ var Casper = function Casper(options) {
this.checker = null;
this.cli = phantom.casperArgs;
this.colorizer = this.getColorizer();
this.currentResponse = undefined;
this.currentUrl = 'about:blank';
this.currentHTTPStatus = 0;
this.defaultWaitTimeout = 5000;
......@@ -1653,6 +1654,7 @@ function createPage(casper) {
casper.resources.push(resource);
}
if (resource.url === casper.requestUrl && resource.stage === "end") {
casper.currentResponse = resource;
casper.currentHTTPStatus = resource.status;
casper.emit('http.status.' + resource.status, resource);
if (utils.isObject(casper.options.httpStatusHandlers) &&
......