I was trying to add authorisation Header while uploading DICOM image to the Orthanc server. If I add authorisation header then I am getting Error 400 as (BAD REQUEST) Response for preflight has invalid HTTP status code 400; without Authorisation header, it’s working fine.
Also, I have changed AuthenticationEnabled to true. I am not able to solve this issue. Any help would be appreciated.
`
`
var form = new
form.append(“data-binary”, file);
`
var xhr = new XMLHttpRequest();
xhr.addEventListener(“readystatechange”, function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
I have used this API without the authorisation header and its working there. If it’s something related with Same Policy, then it should not work in without header request but its working there.
var xhr = new XMLHttpRequest();
xhr.addEventListener(“readystatechange”, function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
Of course, GET and POST don’t have the same use ! My intention was to demonstrate that the authentication is not a problem (this was the subject of your thread).
When POSTing to /instances, the payload shall only contain the binary content of a DICOM file. I doubt this is the case with the “form” you’re trying to POST.
You will find a fully working sample attached to this mail. It consists of a static “index.html” file together with a JavaScript application “app.js.txt” (the “.txt” suffix is there to allow the post on Google Groups).