You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Post requests with Stream contents seem to missing content-type headers #291
When doing some testing of a SwaggerProvider generated file upload function (using s StreamContent to send a file to an endpoint with an expected content-type of application/octet-stream), I found that the client didn't seem to be setting a Content-Type header on the request.
I noticed that after using the client with a test server setup that expected the content type to be specified and returns an error if it's missing.
Is that right?
I checked this via the unit tests by changing one of the existing file upload tests to check for a content-type being specified - e.g. 35549bb and fail if it's missing.
I see that there's code here to set a content-type header on the outer request but I believe there can be issues when setting that on the request rather than on the content, so I tried setting the header on the content as already happens for StringContents and that seemed to fix this case - e.g. ad8d2a8
Activity
Numpsy commentedon Feb 15, 2026
Should be fixed by #292
sergey-tihon commentedon Feb 15, 2026
Released in https://www.nuget.org/packages/SwaggerProvider/3.0.0-beta07