msgraph-sdk-dotnet-core icon indicating copy to clipboard operation
msgraph-sdk-dotnet-core copied to clipboard

Allow application/zip as a valid stream Content-Type if explicitly specified

Open zengin opened this issue 5 years ago • 2 comments

This is to support C# snippet generation for the following HTTP snippet:

https://docs.microsoft.com/en-us/graph/api/teamsapp-update?view=graph-rest-1.0&tabs=http#request

PUT https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/06805b9e-77e3-4b93-ac81-525eb87513b8
Content-type: application/zip
Content-length: 244

[Zip file containing a Teams app package]

We need a check here that Content-Type is not already set before to prevent always assuming application/octet-stream: https://github.com/microsoftgraph/msgraph-sdk-dotnet-core/blob/dev/src/Microsoft.Graph.Core/Requests/BaseRequest.cs#L257 AB#7184

zengin avatar Oct 14 '20 19:10 zengin

Note to self that the generated API sets the ContentType to default octet-stream for HasStream. If a customer sets HeaderOption for ContentType in .Request(), we must use that value instead of the generated default value

MIchaelMainer avatar Oct 15 '20 17:10 MIchaelMainer

  • [ ] Open issues on Java, JS, and PowerShell.

cc:/ @peombwa @nikithauc @baywet

MIchaelMainer avatar Oct 15 '20 20:10 MIchaelMainer

Closing this one for now.

If the content type is specified explicitly in a RequestInformation instance in its header collection, the Kiota abstractions will not override the header

andrueastman avatar Jan 05 '23 06:01 andrueastman