Mendix shouldn’t be overwriting a configuration like that under the hood (and it doesn’t look like there is documentation to support the idea that it does). That said, there are instances where request headers are inserted by the Mendix Cloud itself, as well as instances where Mendix will not interfere, or where they will entirely overwrite.
I would check out the documentation below and see if any of these headers are the ones you’re using, and note that Mendix may be overwriting them.
https://docs.mendix.com/developerportal/deploy/mendix-cloud-request-headers/
There is a possibility that this is an Azure related error. A few thoughts:
- Have you checked that the content of the data is indeed binary
- If it is binary, is it empty?
- How much content are we talking? It does look like there is a size limit for file uploads – anything between 3MB and 150MB will require an upload session.
https://learn.microsoft.com/en-us/graph/outlook-large-attachments?tabs=http
Here are some of my settings:
It looks to me like the RequestContent() function is always called with Overwrite as false which leads to the error I'm experiencing.
if (this.overwrite) {
request.removeHeaders(HttpHeaders.TRANSFER_ENCODING);
request.removeHeaders(HttpHeaders.CONTENT_LENGTH);
} else {
if (request.containsHeader(HttpHeaders.TRANSFER_ENCODING)) {
throw new ProtocolException("Transfer-encoding header already present");
}
if (request.containsHeader(HttpHeaders.CONTENT_LENGTH)) {
throw new ProtocolException("Content-Length header already present");
}
}
The error message mentions the Content-Range header, not the Content-Length header? Did you try to add a Content-Range header?
Hi Luuk Damink,
Have you managed to resolve this issue? I am also getting the same error while trying to upload the file binary to Azure blob storage using PUT call.