Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added casper.currentResponse to access latest received response object

  • Loading branch information...
commit a34fbd9e2c9b173dd56e9567d59fd48b08f4587c 1 parent a12ef8f
Nicolas Perriault authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  modules/casper.js
2  modules/casper.js
View
@@ -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;
@@ -1657,6 +1658,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) &&
Please sign in to comment.
Something went wrong with that request. Please try again.