由于 {_parts},React Native `Formdata` 无法将数据发送到后端
我不知道为什么在 react native
formData
中使用在 {_parts} 中发送数据,并为数据字段提供响应作为此字段需要 400 错误...
在后端无法接收{_parts}
有人遇到这个问题请让我知道我自 1 周以来就陷入了这个问题..但是使用 formData
在网络应用程序中工作正常它就像给定图像
i don't know why in react native
formData
use to send data in {_parts} and that gives response for data field as this field is required with 400 error...
in backend it not able to receive in {_parts}
have anyone go through this issue please let me know I am stuck in this since 1week.. but working fine in web application using formData
it simply goes like the given image
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它的工作原理是这样的,所以它的正常
React Native Form Data 用于发送表单数据,其中还包括文件,因此在与 FormData 一起使用时,设置标头“Content-Type”:“multipart/formdata”,我认为您后端应该理解这一点。
请参阅下面的链接,该链接是有关如何在 React Native 中发送数据的文章,该文章在 Node 和 Express 中也有后端代码。
此链接
这应该会让您清楚地了解。
It works like that so its normal
React Native Form Data is used to send form data which also includes files so when using with FormData, set header 'Content-Type':'multipart/formdata' and i think you backend should understand this.
Refer the link below which is article to how send data in react native which also has backend code in Node and Express.
This Link
This Should get you idea clear.