MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / sendRequest

Method sendRequest

Libraries/Network/RCTNetworking.macos.js:24–48  ·  view source on GitHub ↗
(
    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

Calls 1

getPartsMethod · 0.80

Tested by

no test coverage detected