What Is Application Octet Stream
I am exploring ASP.NET Web API and I have trouble with a Post method that has the signature HttpResponseMessage Post(SubmitFeed request) In order to take in an object as an argument it seems that it depends on the ContentType. If the ContentType is not 'application/xml' then the Post method will not get called even though the data is XML (in my case the ContentType was 'application/octet-stream'. The easiest fix would be to hard code the ContentType but how can I get the Post method to deserialize the content when the ContentType is 'application/octet-stream'? Kevin Burton So it looks like I need to reframe the question. Assistir series online gratis legendado. I guess I want 'conditional deserialization'. So when the ContentType is 'application/octet-stream' it will read in the data and properly deserialize it to the object but if the ContentType is 'application/xml' it seems that nothing needs to be done. I guess we should support ContentType of 'application/json' also.
What Is Application/octet-stream Content Type
Is this possible? It is a matter of setting formatters: but again how do you deserialize if the content-type is 'application/octet-stream'? Unless you somehow create a harcoded custom MediaTypeFormatter for each route and type or have a list of types you expect and just try to deserialize. This gets me started. In the blog I see the formatters added like: GlobalConfiguration.Configuration.Formatters.JsonFormatter.