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

200
Vistas
Axios post requests are not working with Cordova in Quasar

It's really weird. I opened the dev server of my quasar app and everything works fine. GET requests also work, POST requests also work with my server (Hosted). I use the Axios package to do so. But when I build the app for android using Cordova, only GET requests work, when I test with my phone.

To realize what's happening: I used a ref. So when the app starts the data coming from the GET request is stored in a ref. So if the ref is true the data display in a <p> tag since there is no console option in the mobile app to check the returned data. It's working the data is being rendered from the GET request. I did the same thing to test the POST request, I made a form, and after submit the data is going to the server, and returning back data will be stored in a ref too. I have another <p> tag to render that data (which shows if the ref is true). However this is not happening, the POST request doesn't work at all I checked the PHPMyAdmin in the server too no data has been inserted.

I'm really struggling with this. Really appreciate it if somebody could help me with this. Why POST requests are not working with Cordova after build and only working with the web?. I have attached my code below. Thanks.

<template>
  <q-page class="flex flex-center">
    <q-form @submit.prevent="registerUser" class="q-gutter-md">
      <q-input
        type="text"
        autofocus
        v-model="userForm.username"
        label="Username"
        color="info"
      />
    </q-form>
    <p v-if="userData">{{userData }}</p>
  </q-page>
</template>

<script setup>
import { ref, reactive } from "vue";

const userData = ref();

const userForm = reactive({
 username: '',
});

const registerUser = async () => {
  await axios
    .post(`urlhere/register_app_user`, userForm)
    .then((response) => {
      userData.value = response.data;
    });
};
</script>

However, this POST request works on the web. But after I build it to android using Cordova it doesn't work. I use Laravel for backend

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