0

I have two type of servers which contain some information. One of them is Interface Server that is used for collecting all information in one place and pass it to mobile devices.
I used httpClient to get JSON data with REST from data servers.
I want to pass this json data directly to the mobile devices without any deserialization or serialization in my Interface Server.

String is a good solution but it deserializes this result from json:

"\"{\\\"Count\\\":5}\""

How can I achieve this?

Just Shadow
  • 10,860
  • 6
  • 57
  • 75
Nasir Jafarzadeh
  • 6,123
  • 1
  • 13
  • 19
  • 1
    in that case, string is _not_ a good solution, is it? Have you tried NewtonSoft.JSON? You can keep everything in object form and pass it around your app. Then send it on to the client unchanged. The library will take care of serialising, and should pass on an identical object. – ADyson Feb 27 '17 at 15:30
  • @ADyson can you explain how can I do this? – Nasir Jafarzadeh Feb 27 '17 at 16:07
  • http://www.newtonsoft.com/json/help/html/DeserializeObject.htm and http://www.newtonsoft.com/json/help/html/SerializeObject.htm will start you off. Although if you're using MVC to return data to the client, you can just use the JSONResult class and return your object directly, it uses NewtonSoft underneath anyway. You can easily google how to return JSON from MVC. – ADyson Feb 27 '17 at 16:21

0 Answers0