Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
Axios running on Capacitor recieves the correct response in Catch Block only in IOS

I have wrapped my react app with capacitor 3.0. Using Axios 0.21.4 version. Api calls are working as expected in Web and android. However in IOS, the request reaches the server and server sends the correct response back. The response is being caught in catch block of axios as Network Error which consists of the request data i sent to server.

const apiurl = "https://xxxx.xxx.com/receiptReader";
const upload = async (e) => {
  const frmdata = new FormData();
  frmdata.append("file", document.getElementById("a").files[0]);

  await axios({
    method: "post",
    url: apiurl,
    data: frmdata,
    headers: {
      Authorization: "ccccc@hotmail.com",
      "Content-Type": "multipart/form-data",
    },
  }).then((response) => {
      console.log(response);
      setHi(JSON.stringify(response));
    })
    .catch((error) => {
      console.log(error.message);
      console.log("error");
    });
};

I didnt change any config for ios. Its the same given with capacitor. Any help would be absolutely grateful in this regard.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda