Override automatically setting Content-Length header
When trying to upload a file to MS Azure's file storage using their REST API, [the documentation](https://learn.microsoft.com/en-us/rest/api/storageservices/create-file) specifies that the Content-Length header is optional and if supplied, that it must be set to zero (0). Given this, I have two requests:
1. Provide a means to override automatically setting the Content-Length header, so that the caller can specify their own value or leave it completely absent, and
2. when the header is automatically set, for it to be reflected in the responseOriginalRequest property of the Response data type.
The absence of the second requested behavior took me a while to figure out why the REST API calls were failing.
关闭于 2025-06-16 1 条评论