Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react native multipart/form-data; not working on debug mode #4910

Open
ugoconsonni opened this issue Aug 11, 2022 · 2 comments
Open

react native multipart/form-data; not working on debug mode #4910

ugoconsonni opened this issue Aug 11, 2022 · 2 comments

Comments

@ugoconsonni
Copy link

Describe the issue

Request using Form data work if debug mode is not activate with version 0.27.2 but statusText was undefined
If i using version 0.26.0, this work in debug mode but don't work in production mode and statusText was defined.

Example Code

loginUser: (data) => {
let formdata = new FormData();
formdata.append("l", data.username)
formdata.append("p", data.password)
return instance({
method: 'post',
url:"admin/requetes_ws_divers.php?ajaxAction=WSlogin",
data:formdata,
headers: {"Content-Type": "multipart/form-data;" },
})
}

Environment

  • Axios Version 0.27.2 || 0.26.0
  • React Native 0.68.2
@samarkalra
Copy link

Try this:-

import { stringify } from "query-string"; // This line

return instance({
method: 'post',
url:"admin/requetes_ws_divers.php?ajaxAction=WSlogin",
data: stringify(formdata), // This line
headers: {"Content-Type": "multipart/form-data;" },
})

@Sunhat
Copy link

Sunhat commented Oct 15, 2023

@samarkalra shouldn't be needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants