I am trying to upload an instance in my react js application.
This works but i don’t get a response body returned to the request.
const formData = new FormData();
formData.append('file', file);
const response = await axios.post('https://my-orthanc-server/instances', formData, {
headers: {
'Content-Type': 'application/octet-stream',
},
})
But this doesn’t(when i convert file to binary)
const binaryData = await file.arrayBuffer();
const response = await axios.post('https://my-orthanc-server/instances', binaryData, {
headers: {
'Content-Type': 'application/octet-stream',
},
});
When i use the fetch API, i get an err TypeError: Failed to fetch
. I have my orthanc server running behind nginx.
Please what do i need to do to upload an instance from the client side, and get the response body of the successful request