It's ok, I found this stackoverflow that explains the additional steps.
Uploading A File via Rest API to ADL Gen2 - Return Error "The Content-Length request header must be zero"
I am using the REST API for Azure Data Lake Gen2 to upload a file, via the Path/Create
I have set the headers,
Authorization : Bearer xxxxx
Content-Type : <calculated when request is sent>
The body is a blob.
Then use the URL PUT https://{accountName}.{dnsSuffix}/{filesystem}/{path}?resource=file
It returns the error,
"error": {
"code": "ContentLengthMustBeZero",
"message": "The Content-Length request header must be zero.\nRequestId:d5ed69b7-801f-006b-6845-aeac2b000000\nTime:2021-09-20T17:35:53.4042248Z"
}
If I overide the Content-Length and set it to 0, then it works, but the file created is of 0 bytes, I want to use the binary from the body to create the file, but setting Content-Length to be the length of the body generates the above error. How should I be attaching the file to the request if the Content-Length must be 0 ?