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

218
Views
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 answers
Answer question

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 Report
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!