I wrote a web service that converts the TP-Open Service XML response to JSON format. I am new to WCF and am writing Webservice. But the converted JSON format is displayed as follows.
"{ \"data\": { \"current_condition\": [ {\"cloudcover\": \"25\", \"humidity\": \"48\", \"observation_time..
How to remove these backslashes \ and my code so far.
public string checkweather(string q, string num_of_day)
{
HttpWebRequest request=..;
...
string Url = string.Format("http://free.worldweatheronline.com/feed/weather.ashx?q={0}&format={1}&num_of_days={2}&key={3}", q, format, num_of_days, key);
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(Url);
Request.Method = "GET";
using (HttpWebResponse response = (HttpWebResponse)Request.GetResponse())
{
using (Stream stream = response.GetResponseStream())
{
using (StreamReader reader = new StreamReader(stream))
{
var result2=reader.ReadToEnd();
}}}
return result2;
}
Please let me know if you need more information.
Thiri source
share