I have a class that name is Advertisement:
public class Advertisement
{
public string Title { get; set; }
public string Desc { get; set; }
}
"ExceptionMessage": "No MediaTypeFormatter is available to read an object of type 'Advertisement' from content with media type 'application/octet-stream'.",
That means that your application cannot read octet-stream Content-Type - which is what the request provided. This is one frustration I have with Web API. However there is a way around it. The easy way is to modify the Content-type to 'application/json' or 'application/xml' which is easily read. The harder way is to provide your own MediaTypeFormatter.