mardi 5 octobre 2021

C# Web API returns xml in double quotes

In a C# .NET Web API, I stored properly formated xml data in a string data type, when I return a response, it appends double quotes arround it like this

"<part>
  <name>Windscreen Wiper</name>
  <description>The Windscreen wiper It has a rubber</description>
</part>"

what can be the example code of response that retuns xml without quotes my code looks like this

return CreatedAtRoute("DefaultApi", new { id = respPart.Id }, respPart.stringTypeXML);



Aucun commentaire:

Enregistrer un commentaire