Permudious
New Member
- Dec 28, 2014
- 25
- 1
Good evening,
I am developing a Web API for the first time, where I should like expect a JSON output.
Whatever I try with a return I still have an invalid response.
This is the output:
"[{\"TemperatureAquarium\":\"27.0\",\"TemperatureAquariumShrt\":\"27\",\"TemperatureSump\":\"26.7\",\"TemperatureSumpShrt\":\"26\"}]"
But in my opinion it should be;
[{"TemperatureAquarium":"27.0","TemperatureAquariumShrt":"27","TemperatureSump":"26.7","TemperatureSumpShrt":"26" }]
I already tried things like replace(@"\","") or replace("\\", string.empty) for removing the backslashes, but they still got there.
Even when I add the option Formatting.Intended it goes wrong.
the return code is; return JsonConvert.SerializeObject(TemperatureList);
What do I wrong?
I am developing a Web API for the first time, where I should like expect a JSON output.
Whatever I try with a return I still have an invalid response.
This is the output:
"[{\"TemperatureAquarium\":\"27.0\",\"TemperatureAquariumShrt\":\"27\",\"TemperatureSump\":\"26.7\",\"TemperatureSumpShrt\":\"26\"}]"
But in my opinion it should be;
[{"TemperatureAquarium":"27.0","TemperatureAquariumShrt":"27","TemperatureSump":"26.7","TemperatureSumpShrt":"26" }]
I already tried things like replace(@"\","") or replace("\\", string.empty) for removing the backslashes, but they still got there.
Even when I add the option Formatting.Intended it goes wrong.
the return code is; return JsonConvert.SerializeObject(TemperatureList);
What do I wrong?