c# - should web api content negotiation from xml to json insert @? -
i have xml document want return via web api call.
i want allow user option of 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 request accept header of application/json get:
{ "myexport": { "@someproperty": "some value" } }
is correct @ included in property name?
if why?
Comments
Post a Comment