Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!