An Azure service that provides an event-driven serverless compute platform.
Thank You for following up. I switched to HttpClientFactory and everything started working. Thank You for your help.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Good afternoon. I have an Azure function that is triggered when a blob drops into a blob container in an azure storage account. The function uses an HttpClient library asynchronous post to sharepoint via the sharepoint REST API. When I download the resulting zip file from Sharepoint, I am unable to open the file with Windows extractor (it will open with WinRar, but that is not the end goal). I then use a utility to open the same file in my Azure storage and compare with the file that I sent to Sharepoint. The Sharepoint file has additional header data in it. If I manually remove the header data from the corrupted file, I can open the file with Windows Extractor. A little further information, the additional header in the corrupt file is the content-disposition header.
An Azure service that provides an event-driven serverless compute platform.
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Thank You for following up. I switched to HttpClientFactory and everything started working. Thank You for your help.
Thanks for reaching out to Q&A forum.
You can remove the header using the below code programmatically
HttpContext.Current.Response.Headers.Remove("Header-name");
Similar discussion here: https://stackoverflow.com/questions/3418557/how-to-remove-asp-net-mvc-default-http-headers
Please note that, this issue is not related to Azure functions. You should be able reproduce this issue outside the Azure environment as well.
I hope this helps!
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.