-1
using Newtonsoft.Json;
JsonConvert.SerializeObject(response);

but getting in postman response like extra qoutes and escape sequence in string so that can not be parse in json again

"{\"Data\":null,\"Message\":null,\"Status\":0}"
stuartd
  • 70,509
  • 14
  • 132
  • 163
  • You need to show a little bit more about the method that is serializing response – pinkfloydx33 Feb 08 '21 at 12:44
  • If the two linked duplicates don't answer your question, please do [edit] your question to include a [mcve] and we can re-open the question for a more specific answer. – dbc Feb 08 '21 at 14:17

1 Answers1

0

If you are in a controller and using SerializeObject(response) it will return a string object, so it's normal you get the extra quote at the start/end of your JSON.

If you are in a ASP.NET controller you should juste return the response directly like this :

return response

And the framework will take care of serializing it into JSON (or even another format if needed). It's not a concern you should take care of.

Arcord
  • 1,724
  • 1
  • 11
  • 16