Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: polymer_0.5.4/bower_components/core-ajax/core-xhr.html

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 * @param {Object} inOptions.callback Called when request is completed. 44 * @param {Object} inOptions.callback Called when request is completed.
45 * @returns {Object} XHR object. 45 * @returns {Object} XHR object.
46 */ 46 */
47 request: function(options) { 47 request: function(options) {
48 var xhr = new XMLHttpRequest(); 48 var xhr = new XMLHttpRequest();
49 var url = options.url; 49 var url = options.url;
50 var method = options.method || 'GET'; 50 var method = options.method || 'GET';
51 var async = !options.sync; 51 var async = !options.sync;
52 // 52 //
53 var params = this.toQueryString(options.params); 53 var params = this.toQueryString(options.params);
54 if (params && method == 'GET') { 54 if (params && method.toUpperCase() == 'GET') {
55 url += (url.indexOf('?') > 0 ? '&' : '?') + params; 55 url += (url.indexOf('?') > 0 ? '&' : '?') + params;
56 } 56 }
57 var xhrParams = this.isBodyMethod(method) ? (options.body || params) : n ull; 57 var xhrParams = this.isBodyMethod(method) ? (options.body || params) : n ull;
58 // 58 //
59 xhr.open(method, url, async); 59 xhr.open(method, url, async);
60 if (options.responseType) { 60 if (options.responseType) {
61 xhr.responseType = options.responseType; 61 xhr.responseType = options.responseType;
62 } 62 }
63 if (options.withCredentials) { 63 if (options.withCredentials) {
64 xhr.withCredentials = true; 64 xhr.withCredentials = true;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 xhr.setRequestHeader(name, headers[name]); 107 xhr.setRequestHeader(name, headers[name]);
108 } 108 }
109 } 109 }
110 } 110 }
111 111
112 }); 112 });
113 113
114 </script> 114 </script>
115 115
116 </polymer-element> 116 </polymer-element>
OLDNEW
« no previous file with comments | « polymer_0.5.4/bower_components/core-ajax/core-ajax.html ('k') | polymer_0.5.4/bower_components/core-ajax/demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698