I'm working on project where i have to make an API request. When I post a JSON request to the server I get the following XML as response:
"<response>
\r\n
<data>
\r\n
<status no=\"0\" substatus=\"0\">
Connection succeeded
</status>\r\n
</data>
\r\n
</response>"
I need to convert the response back to JSON. But when I try to parse it i'm getting an error saying
'Unexpected character encountered while parsing value: <. Path '', line 0, position 0.'
I'm using NewtonSoftJSON for conversion.
This is the code I'm using to convert the XML string back to JSON:
var response = JsonConvert.DeserializeXmlNode(xmlResponse);
How can I achieve this?