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

220
Vistas
FiveM NUI Js normal API request

I try to make a normal get-request in javascript in a Vue3 side in FiveM NUI. In chrome everything works just fine but if I open the Page in FiveM nothing loads.

fetch("http://xxx.xxx.xxx.xxx:xxxx/postinserat", {
   method: "POST",
   headers: {'Content-Type': 'application/json'}, 
   body: JSON.stringify(data)
}).then(res => {
   console.log("Request complete! response:", res);
   this.titel = "";
   this.beschreibung = "";
   this.telefonnummer = "";
   this.preis = "";
   this.currentPage = 0;
   this.getInserate();
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Fivem doesn't have fetch function by default so you have to install it trough (Node.js).

  • Install node-fetch v2 with npm i node-fetch@2
  • Add this to very top of your code: const fetch = require("node-fetch");

We use v2 because the latest fetch is v3 which uses ES modules that won't work with require.

about 4 years ago · Juan Pablo Isaza Denunciar
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