[ReactNative] fix up XMLHttpRequest failures

This commit is contained in:
Kevin Gozali 2015-07-31 18:54:25 -07:00
parent d858d0c4e0
commit ee8b50c955
1 changed files with 5 additions and 7 deletions

View File

@ -102,19 +102,17 @@ class XMLHttpRequest extends XMLHttpRequestBase {
}
sendImpl(method: ?string, url: ?string, headers: Object, data: any): void {
var body;
if (typeof data === 'string') {
body = {string: data};
} else if (data instanceof FormData) {
body = {formData: data.getParts()};
} else {
body = data;
data = {string: data};
}
if (data instanceof FormData) {
data = {formData: data.getParts()};
}
RCTNetworking.sendRequest(
{
method,
url,
body,
data,
headers,
incrementalUpdates: this.onreadystatechange ? true : false,
},