@@ -6,10 +6,9 @@ import XMLHttpRequestEventTarget from './XMLHttpRequestEventTarget.js';
6
6
import Log from '../utils/log.js' ;
7
7
import Blob from './Blob.js' ;
8
8
import ProgressEvent from './ProgressEvent.js' ;
9
- import URIUtil from ' ../utils/uri' ;
10
- import { NativeModules } from "react-native " ;
9
+ import URIUtil from " ../utils/uri" ;
10
+ import { config } from "../fetch " ;
11
11
12
- const ReactNativeBlobUtil = NativeModules . ReactNativeBlobUtil ;
13
12
const log = new Log ( 'XMLHttpRequest' ) ;
14
13
15
14
@@ -183,7 +182,7 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget {
183
182
} ;
184
183
}
185
184
log . debug ( 'body created send request' ) ;
186
- body = ReactNativeBlobUtil . wrap ( blob . getReactNativeBlobUtilRef ( ) ) ;
185
+ body = URIUtil . wrap ( blob . getReactNativeBlobUtilRef ( ) ) ;
187
186
resolve ( ) ;
188
187
} ) ;
189
188
} ) ;
@@ -203,13 +202,12 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget {
203
202
_headers [ h ] = _headers [ h ] . toString ( ) ;
204
203
}
205
204
206
- this . _task = ReactNativeBlobUtil
207
- . config ( {
208
- auto : true ,
209
- timeout : this . _timeout ,
210
- increment : this . _increment ,
211
- binaryContentTypes : XMLHttpRequest . binaryContentTypes
212
- } )
205
+ this . _task = config ( {
206
+ auto : true ,
207
+ timeout : this . _timeout ,
208
+ increment : this . _increment ,
209
+ binaryContentTypes : XMLHttpRequest . binaryContentTypes
210
+ } )
213
211
. fetch ( _method , _url , _headers , body ) ;
214
212
this . _task
215
213
. stateChange ( this . _headerReceived )
0 commit comments