React Native Http请求在Android中不起作用 [英] React Native Http request dont work in Android

查看:73
本文介绍了React Native Http请求在Android中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用FetchAxios 处理对服务器的请求,在Android 模拟器/设计上运行它时,它向我显示以下错误:

Working with requests to the server using Fetch and also using Axios, when running it on Android emulator/devise it shows me the following error:

这是请求代码:

fetch(URL,{
      method: 'POST',
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
                email: userEmail,
                password: userPassword
            }),

        })
        .then((response) => response.json())
         .then((responseJson)=>{
             Alert.alert("bien");
       console.warn(responseJson);
             })
         .catch((error)=>{
         console.error(error);
     console.warn(error);
   });

推荐答案

嗯,问题出在 URL 的 SSL 证书上

Well the problem was with the SSL certificate of the URL

这篇关于React Native Http请求在Android中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆