My WCF REST service method:
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml)]
Metadata[] Extract(Stream stream);
Is failing, and returing an error to the client indicating that the content type is incorrect.
The error message from WCF is “The remote server returned an error: (415) Missing Content Type.”.
How do I accept a stream with any content type, and not have to set the content-type in the client. If I set the content type to application/octet-stream it works. I would ideally like the WCF method to accept the stream regardless of the content type.
Thanks.
According to this post – you need to use the WCF Web API to get low-level access to the request or use a request parameter that supports streaming (MTOM).