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

308
Views
Fetch TypeError: Network request failed React Native

I try do the next fetch with react-native android 12 API 28

(import FormData from 'form-data';)

   let formData = new FormData();
        const file = new File(["foo"], "foo.txt",
            "text/plain",
        );

   let textFile = {
         uri: file.uri,
            name: "foo.txt",
            type: "text/plain"
        };

        formData.append("photo", textFile);
        formData.append('description', 'helli');

fetch(url, {
            method: 'post',
            headers: formData.getHeaders,
            body: formData
        }).then(response => {
            console.log("image uploaded")
        }).catch(err => {
            console.log(err)
        })

y Try with localhost (http) and heroku (https) but it does not work

The Error is: [TypeError: Network request failed]

the description field is fine but the file appears as null

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!