"Invalid CORS request" error in Webview used in React Native

Viewed 2069

(also posted in https://github.com/facebook/react-native/issues/20989)

I am trying to render WebView in a React Native application, and I get "Invalid CORS request" error.

I have read several discussions of this (e.g. Android Webview: disable CORS), but none is involving React Native. Is there any way to overcome this problem in React Native?

Here is the render code:

return (
      <View style={styles.container}>
        <WebView style={styles.webview}
            source={{
              uri: uri,
              method: 'POST',
              body: `apiKey=${apiKey}&broker=${broker}` }}
            javaScriptEnabled={true}
            domStorageEnabled={true}
            startInLoadingState={false}
            scalesPageToFit={true} />
      </View>
    );
0 Answers
Related