| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 6 Code distributed by Google as part of the polymer project is also | 6 Code distributed by Google as part of the polymer project is also |
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 8 --> | 8 --> |
| 9 <!-- | 9 <!-- |
| 10 /** | 10 /** |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return r.join('&'); | 82 return r.join('&'); |
| 83 }, | 83 }, |
| 84 | 84 |
| 85 isBodyMethod: function(method) { | 85 isBodyMethod: function(method) { |
| 86 return this.bodyMethods[(method || '').toUpperCase()]; | 86 return this.bodyMethods[(method || '').toUpperCase()]; |
| 87 }, | 87 }, |
| 88 | 88 |
| 89 bodyMethods: { | 89 bodyMethods: { |
| 90 POST: 1, | 90 POST: 1, |
| 91 PUT: 1, | 91 PUT: 1, |
| 92 PATCH: 1, |
| 92 DELETE: 1 | 93 DELETE: 1 |
| 93 }, | 94 }, |
| 94 | 95 |
| 95 makeReadyStateHandler: function(xhr, callback) { | 96 makeReadyStateHandler: function(xhr, callback) { |
| 96 xhr.onreadystatechange = function() { | 97 xhr.onreadystatechange = function() { |
| 97 if (xhr.readyState == 4) { | 98 if (xhr.readyState == 4) { |
| 98 callback && callback.call(null, xhr.response, xhr); | 99 callback && callback.call(null, xhr.response, xhr); |
| 99 } | 100 } |
| 100 }; | 101 }; |
| 101 }, | 102 }, |
| 102 | 103 |
| 103 setRequestHeaders: function(xhr, headers) { | 104 setRequestHeaders: function(xhr, headers) { |
| 104 if (headers) { | 105 if (headers) { |
| 105 for (var name in headers) { | 106 for (var name in headers) { |
| 106 xhr.setRequestHeader(name, headers[name]); | 107 xhr.setRequestHeader(name, headers[name]); |
| 107 } | 108 } |
| 108 } | 109 } |
| 109 } | 110 } |
| 110 | 111 |
| 111 }); | 112 }); |
| 112 | 113 |
| 113 </script> | 114 </script> |
| 114 | 115 |
| 115 </polymer-element> | 116 </polymer-element> |
| OLD | NEW |