Method
sendRequest
(
method: string,
trackingName: string,
url: string,
headers: Object,
data: string | FormData | {uri: string},
responseType: 'text' | 'base64',
incrementalUpdates: boolean,
timeout: number,
callback: (requestId: number) => any
)
Source from the content-addressed store, hash-verified
| 22 | } |
| 23 | |
| 24 | sendRequest( |
| 25 | method: string, |
| 26 | trackingName: string, |
| 27 | url: string, |
| 28 | headers: Object, |
| 29 | data: string | FormData | {uri: string}, |
| 30 | responseType: 'text' | 'base64', |
| 31 | incrementalUpdates: boolean, |
| 32 | timeout: number, |
| 33 | callback: (requestId: number) => any |
| 34 | ) { |
| 35 | const body = |
| 36 | typeof data === 'string' ? {string: data} : |
| 37 | data instanceof FormData ? {formData: data.getParts()} : |
| 38 | data; |
| 39 | RCTNetworkingNative.sendRequest({ |
| 40 | method, |
| 41 | url, |
| 42 | data: {...body, trackingName}, |
| 43 | headers, |
| 44 | responseType, |
| 45 | incrementalUpdates, |
| 46 | timeout |
| 47 | }, callback); |
| 48 | } |
| 49 | |
| 50 | abortRequest(requestId: number) { |
| 51 | RCTNetworkingNative.abortRequest(requestId); |
Callers
nothing calls this directly
Tested by
no test coverage detected