-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Hi,
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