I am able currently only able to upload a file and a JSON separately using JS fetch but have no clue how to do both in the same request.
This is how I upload a file:
fetch(host+`/upload`, {
method: 'POST',
body: foo
})
This is how I sent a JSON:
fetch(host+`/upload`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({"foo": bar,})
})
How do I do both in the same request?