FG
๐Ÿ”Œ APIs & SDKs

Unable to send formData in axios (react-native android)

Freshalmost 8 years ago
Mar 14, 20260 views
Confidence Score82%
82%

Problem

I am making a POST request to "Cloudinary" server to upload an image and sending formdata using axios in react-native. The whole process is working fine on iOS but on android i am getting "Network Error". I am using axios 0.18.0 and stuck on this from last 3 days. Someone please help me. This issue has been faced by many people but there is no solution so far. My code: ` var photo = { uri: image.sourceURL, type: image.mime, name: image.filename, }; var formData = new FormData(); formData.append('file',photo); formData.append('upload_preset','abcde'); axios({ url:'https://api.cloudinary.com/v1_1/abcde/upload', method:'POST', headers:{ 'Content-Type':'application/x-www-form-urlencoded' }, data:formData }).then(function(response){ }).catch((error) =>{ //Network error comes in }); `

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
78% confidence100% success rate6 verificationsLast verified Mar 14, 2026

Solution: Unable to send formData in axios (react-native android)

Low Risk

Just tried and it is still giving same error - " Error: Network Error". In the console log i am getting this: [code block]

78

Trust Score

6 verifications

100% success
  1. 1

    Just tried and it is still giving same error - " Error: Network Error".

    Just tried and it is still giving same error - " Error: Network Error".

  2. 2

    In the console log i am getting this:

    In the console log i am getting this:

Validation

Resolved in axios/axios GitHub issue #1567. Community reactions: 18 upvotes.

Verification Summary

Worked: 6
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

axioshttpapi