I am trying to call a form-data content type API, where image is optional. That is working in postman as shown in below picture.
I am trying like below way
let body = new FormData()
if (imageData != null) {
body.append('image', {
uri: imageData.uri,
name: imageData.fileName,
type: imageData.type
})
} else {
body.append('image', new Blob([]))
// body.append('image', null) -> tried
// body.append('image', "") -> tried
// -> tried
// body.append('image', {
// uri: "",
// name: "",
// type: ""
// })
// -> tried
// body.append('image', {
// uri: ""
// })
}
How can i call API just like that is showed in the postman image. Without selecting an Image.