I have an xml document that I want to return via a web api call.
I want to allow the user the option of the response via content negotiation.
[HttpGet]
public HttpResponseMessage Get()
{
var doc = new XmlDocument();
doc.LoadXml("<MyExport SomeProperty='Some Value'></MyExport>");
return Request.CreateResponse(HttpStatusCode.OK, doc);
}
When I request this an Accept header of application/json I get:
{
"MyExport": {
"@SomeProperty": "Some Value"
}
}
Is it correct that @ is included in the property name?
If so why?