Skip to content

Commit 21e7e35

Browse files
motiz88facebook-github-bot
authored andcommitted
Deprecate NetworkingModule.sendRequestInternal
Summary: Changelog: [Android][Deprecated] Mark `NetworkingModule.sendRequestInternal` as deprecated The `NetworkingModule.sendRequestInternal` method is an implementation detail of the `sendRequest` method and does not need to be public. In this diff, we mark it as deprecated ahead of removing it from the public API in a future release of React Native. Differential Revision: D84250142
1 parent 8cc9bbc commit 21e7e35

File tree

1 file changed

+27
-1
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network

1 file changed

+27
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public class NetworkingModule(
222222
val requestId = requestIdAsDouble.toInt()
223223
val timeout = timeoutAsDouble.toInt()
224224
try {
225-
sendRequestInternal(
225+
sendRequestInternalReal(
226226
method,
227227
url,
228228
requestId,
@@ -245,6 +245,7 @@ public class NetworkingModule(
245245
}
246246
}
247247

248+
@Deprecated("""sendRequestInternal is internal and will be made private in a future release.""")
248249
/** @param timeout value of 0 results in no timeout */
249250
public fun sendRequestInternal(
250251
method: String,
@@ -256,6 +257,31 @@ public class NetworkingModule(
256257
useIncrementalUpdates: Boolean,
257258
timeout: Int,
258259
withCredentials: Boolean,
260+
) {
261+
sendRequestInternalReal(
262+
method,
263+
url,
264+
requestId,
265+
headers,
266+
data,
267+
responseType,
268+
useIncrementalUpdates,
269+
timeout,
270+
withCredentials,
271+
)
272+
}
273+
274+
/** @param timeout value of 0 results in no timeout */
275+
private fun sendRequestInternalReal(
276+
method: String,
277+
url: String?,
278+
requestId: Int,
279+
headers: ReadableArray?,
280+
data: ReadableMap?,
281+
responseType: String,
282+
useIncrementalUpdates: Boolean,
283+
timeout: Int,
284+
withCredentials: Boolean,
259285
) {
260286
val reactApplicationContext = getReactApplicationContextIfActiveOrWarn()
261287
try {

0 commit comments

Comments
 (0)