How to post multipart/formdata using fetch in react-native?

后端 未结 3 1540
广开言路
广开言路 2021-02-09 14:13

\"reference

i want to post Form Data like that.

what should i prepare for sending ima

3条回答
  •  天涯浪人
    2021-02-09 14:52

    You need to create an instance of FormData and pass that as the body to fetch, like so:

    const data = new FormData()
    data.append("something", something)
    
    fetch(url, { method: 'POST', body: form })
    

提交回复
热议问题