Skip to content
This repository
Browse code

added casper.currentResponse to access latest received response object

  • Loading branch information...
commit a34fbd9e2c9b173dd56e9567d59fd48b08f4587c 1 parent a12ef8f
Nicolas Perriault authored July 11, 2012

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  modules/casper.js
2  modules/casper.js
@@ -111,6 +111,7 @@ var Casper = function Casper(options) {
111 111
     this.checker = null;
112 112
     this.cli = phantom.casperArgs;
113 113
     this.colorizer = this.getColorizer();
  114
+    this.currentResponse = undefined;
114 115
     this.currentUrl = 'about:blank';
115 116
     this.currentHTTPStatus = 0;
116 117
     this.defaultWaitTimeout = 5000;
@@ -1657,6 +1658,7 @@ function createPage(casper) {
1657 1658
             casper.resources.push(resource);
1658 1659
         }
1659 1660
         if (resource.url === casper.requestUrl && resource.stage === "end") {
  1661
+            casper.currentResponse = resource;
1660 1662
             casper.currentHTTPStatus = resource.status;
1661 1663
             casper.emit('http.status.' + resource.status, resource);
1662 1664
             if (utils.isObject(casper.options.httpStatusHandlers) &&

0 notes on commit a34fbd9

Please sign in to comment.
Something went wrong with that request. Please try again.