Skip to content

Commit 557371a

Browse files
committed
Revert "add support for sending form-data"
This reverts commit 75535a1.
1 parent bcd4933 commit 557371a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

curious-xhr.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function CuriousXhr() {
102102

103103
xhr.request({
104104
url: url,
105-
body: data,
105+
body: ((method === "POST" || method === "PUT") && data) ? JSON.stringify(data) : null,
106106
params: params,
107107
method: method,
108108
headers: headers,
@@ -148,20 +148,11 @@ function CuriousXhr() {
148148
}
149149

150150
function post(url, data, params, content_type, ignore_requested_with) {
151-
if (data)
152-
data = JSON.stringify(data);
153151
var x = _request(url, data, params, content_type, "POST", ignore_requested_with);
154152
return x;
155153
}
156154

157-
function post_form_data(url, form_data, content_type, ignore_requested_with) {
158-
var x = _request(url, form_data, null, content_type, "POST", ignore_requested_with);
159-
return x;
160-
}
161-
162155
function put(url, data, params, content_type, ignore_requested_with) {
163-
if (data)
164-
data = JSON.stringify(data);
165156
var x = _request(url, data, params, content_type, "PUT", ignore_requested_with);
166157
return x;
167158
}

0 commit comments

Comments
 (0)