I am posting this on my web service.
What should I do with React native? multipart \ form-data I have not tried it. Can both form-data and form-encoded-url be used? Thanks in advance.
I am posting this on my web service.
What should I do with React native? multipart \ form-data I have not tried it. Can both form-data and form-encoded-url be used? Thanks in advance.
If you want to post in React-native, you can use formdata as below to upload image to webservice..
var formData = new FormData();
formData.append('image', {uri: link.uri, name: link.name, type: 'image/jpg'});
fetch(url, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'multipart/form-data',
'Authorization': ' Token '+key,
},
body: formData
})