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

487
Views
EXPO React Native - AXIOS + PROBLEMA DE FORMDATA

tengo un problema con la solicitud POST dentro de mi aplicación.

parte del código:

 if (imagesResults !== undefined) { imagesResults.forEach((el) => { let localUri = el.uri; let filename = localUri.split("/").pop(); let match = /\.(\w+)$/.exec(filename); let type = match ? `image/${match[1]}` : `image`; formData.append("saleImages[]", { uri: localUri, name: filename, type: type, }); }); } console.log("FORMDATA", formData); const axiosConfig = { headers: { Authorization: "Bearer " + user.token, "content-type": "application/x-www-form-urlencoded", Accept: "application/json", }, }; try { axios .post(`${API}/sales/${saleId}/edit`, formData, axiosConfig) .then((res) => { // console.log("RES", JSON.stringify(res.data)); bottomSheetRef.current.snapToIndex(0); setTimeout(() => { bottomSheetRef.current.close(); dispatch(setLoadingApiAction(false)); navigation.navigate("My Ads"); }, 3000); }) .catch((err) => { console.log("error", err); // setErrors(err.response.data.errors); navigation.navigate("My Ads"); alert("SOMETHING IS WRONG!"); dispatch(setLoadingApiAction(false)); }); } catch (error) { console.log("ERROR CATCH", error); dispatch(setLoadingApiAction(false)); } };

Entonces, ¿qué está sucediendo? Disparo mi API y obtengo 200, pero justo después de obtener 200, también me devuelve un error de red y entra en la parte .catch.

Esto solo sucede en el DISPOSITIVO ANDROID, IOS funciona totalmente bien.

Estoy usando un HTTPS, también traté de establecer el tipo de imagen codificada en "image/jpeg", pero tuve el mismo problema.

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!