Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/403.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在react native中使用https模块_Javascript_Android_Node.js_React Native - Fatal编程技术网

Javascript 在react native中使用https模块

Javascript 在react native中使用https模块,javascript,android,node.js,react-native,Javascript,Android,Node.js,React Native,我想在react native中使用nodejs中的https标准库模块(我需要针对axios的https.Agent)。有没有合适的方法可以做到这一点?它也可以通过JavaScipt的内置函数“fetch”来执行 例如: fetch('https://mywebsite.com/endpoint/', { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application

我想在react native中使用nodejs中的https标准库模块(我需要针对axios的https.Agent)。有没有合适的方法可以做到这一点?

它也可以通过JavaScipt的内置函数“fetch”来执行

例如:

fetch('https://mywebsite.com/endpoint/', {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    firstParam: 'yourValue',
    secondParam: 'yourOtherValue'
  })
});

更多信息:

也可以使用JavaScipt的内置函数“fetch”执行

例如:

fetch('https://mywebsite.com/endpoint/', {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    firstParam: 'yourValue',
    secondParam: 'yourOtherValue'
  })
});

更多信息:

我将如何配置它以允许自签名证书?我相信它需要在平台配置中实现。可能会有帮助-我如何配置它以允许自签名证书?我相信它需要在平台配置中实现。可能会有帮助-