title: ASP.NET MVC 4 return Json resulting in double json or empty data
body: <p><em><strong>I am getting either empty Json results or double json results and I don't know why yet?</em></strong></p>
  
  <p>base line: 
  <a href="http://learn.knockoutjs.com/mail?folder=Inbox" rel="nofollow">http://learn.knockoutjs.com/mail?folder=Inbox</a>
  looks like this in chrome F12: {"id":"Inbox","mails":[{"id":1,......}</p>
  
  <p>My Action:</p>
  
  <pre><code>public ActionResult Mail()
  {
      string qs = "";
      foreach (var q in Request.QueryString)
      {
  
          qs += string.Format("{0}={1}&amp;", q, Request.QueryString[q.ToString()]);
      }
      var proxyRequest = "http://learn.knockoutjs.com/mail?" + qs;
      var request = WebRequest.Create(proxyRequest);
      var response = (HttpWebResponse)request.GetResponse();
  
  
  
      var reader = new StreamReader(response.GetResponseStream());
      var str = reader.ReadToEnd();
      var data = Newtonsoft.Json.JsonConvert.DeserializeObject&lt;dynamic&gt;(str);
  
      //var json = JsonConvert.SerializeObject(data);  
          // Text Visualization looks good {"id":"Inbox","mails":[{"id":1,"from":"Abb....}
          // no outside quotes, no escaped quotes
  
          var res = Json(data, JsonRequestBehavior.AllowGet);
          return res;
  
  }
  </code></pre>
  
  <p>So basically I am proxying the call, but the question is why is the result coming back as either not filled in or double jsoned.</p>
  
  <p>using chrome network trace the result of the above looks like.
  [[[]],[[[[[]],[[]],[[]],[[]],[[]],...]</p>
  
  <p>valid json, just empty.</p>
  
  <p>when I change the code to look like this</p>
  
  <pre><code>var json = JsonConvert.SerializeObject(data);  
  // Text Visualization looks good {"id":"Inbox","mails":[{"id":1,"from":"Abb....}
  // no outside quotes, no escaped quotes
  
  var res = Json(json, JsonRequestBehavior.AllowGet);
  return res;
  </code></pre>
  
  <p>Chrome network trace has doubled jsoned the data.
  "{\"id\":\"Inbox\",\"mails\":[{\"id\":1,\"from\":\"Ab....}"</p>
  
  <p>Since I don't know what the Json actually is, I did newton soft dynamic convert
  JsonConvert.DeserializeObject</p>
  
  <p>That may be the problem behind my empty response?</p>
  
  <p>Any help would really be appreciated.
  Thanks</p>