Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 3e7a2d5

Browse files
author
Scott J. Miles
committed
expose more xhr features
1 parent 55c4bc3 commit 3e7a2d5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

polymer-ajax/polymer-ajax.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
-->
3939
<link rel="import" href="polymer-xhr.html">
4040

41-
<polymer-element name="polymer-ajax" attributes="url handleAs auto params response">
41+
<polymer-element name="polymer-ajax" attributes="url handleAs auto params response method">
4242
<script>
4343
Polymer('polymer-ajax', {
4444
/**
@@ -90,6 +90,7 @@
9090
* @default null
9191
*/
9292
response: null,
93+
method: '',
9394
created: function() {
9495
this.xhr = document.createElement('polymer-xhr');
9596
},
@@ -165,13 +166,14 @@
165166
* @method go
166167
*/
167168
go: function() {
168-
var args = {};
169+
var args = this.xhrArgs || {};
169170
args.params = this.params || null;
170171
if (args.params && typeof(args.params) == 'string') {
171172
args.params = JSON.parse(args.params);
172173
}
173174
args.callback = this.receive.bind(this);
174175
args.url = this.url;
176+
args.method = this.method;
175177
return args.url && this.xhr.request(args);
176178
}
177179
});

0 commit comments

Comments
 (0)