Two things:
-
You don’t need quotes
""around the content type and accept header values in Fiddler:User-Agent: Fiddler Content-Type: application/xml Accept: application/xml -
Web API uses the
DataContractSerializerby default for xml serialization. So you need to include your type’s namespace in your xml:<TestModel xmlns="http://schemas.datacontract.org/2004/07/YourMvcApp.YourNameSpace"> <Output>Sito</Output> </TestModel>Or you can configure Web API to use
XmlSerializerin yourWebApiConfig.Register:config.Formatters.XmlFormatter.UseXmlSerializer = true;Then you don’t need the namespace in your XML data:
<TestModel><Output>Sito</Output></TestModel>