diff options
author | Katsuyuki Ohmuro <harmony7@pex2.jp> | 2014-05-10 07:28:25 +0900 |
---|---|---|
committer | Katsuyuki Ohmuro <harmony7@pex2.jp> | 2014-05-10 07:28:25 +0900 |
commit | ab48afae7d69d1a72eb65b2a283f54a62f3d52f3 (patch) | |
tree | 0e9cf45b5ccb2bbb73e9002b0b4826bd4b116119 | |
parent | 112a2f7ea7ba79914983a57b1341316432063086 (diff) | |
download | pollymer-ab48afae7d69d1a72eb65b2a283f54a62f3d52f3.tar pollymer-ab48afae7d69d1a72eb65b2a283f54a62f3d52f3.tar.gz |
Adding access to "lastRequest" info.
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | pollymer.js | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index eefc904..a07a04c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,4 +3,5 @@ Pollymer Changelog v. 1.0.0 (01-31-2013) - Initial Release. v. 1.1.0 (04-28-2014) - Support for RequireJS (AMD). -v. 1.1.1 (05-10-2014) - Fixed crashing issue when abort() called on fresh object.
\ No newline at end of file +v. 1.1.1 (05-10-2014) - Fixed crashing issue when abort() called on fresh object. +v. 1.1.2 (05-10-2014) - Adding access to "lastRequest" info.
\ No newline at end of file diff --git a/pollymer.js b/pollymer.js index dd5da75..05d3189 100644 --- a/pollymer.js +++ b/pollymer.js @@ -1,5 +1,5 @@ /** - * Pollymer JavaScript Library v1.1.1 + * Pollymer JavaScript Library v1.1.2 * Copyright 2013-2014 Fanout, Inc. * Released under the MIT license (see COPYING file in source distribution) */ @@ -228,6 +228,8 @@ this.timeout = 60000; this.errorCodes = '500-599'; + this.lastRequest = null; + if (arguments.length > 0) { var config = arguments[0]; if ("transport" in config) { @@ -308,6 +310,7 @@ }; Request.prototype._initiate = function (delayMsecs) { var self = this; + self.lastRequest = null; self._timer = window.setTimeout(function () { self._startConnect(); }, delayMsecs); }; Request.prototype._startConnect = function () { @@ -326,6 +329,14 @@ // cleanup would be a no-no) this._transport = chooseTransport(this.transport, url); + self.lastRequest = { + method: method, + uri: url, + headers: headers, + body: body, + transport: this._transport + }; + switch (this._transport) { case transportTypes.Xhr: consoleInfo("pollymer: Using XHR transport."); |