title: MVC 5 invalid JSON primitive
body: <p>I am trying to write a auto-complete with ajax in MVC5 but no matter what I try I get the error invalid JSON primitive. 
   When I enter the url manually localhost:5088/GetData?inpt=[query] I am able to see the return json. </p>
  
  <p>From what I understand online , I am giving the "data:" parameter wrong. I tried putting them in "" but it didn't work.</p>
  
  <p>My Controller : </p>
  
  <pre><code>  public  JsonResult GetData(string inpt)
          {
              try
              {
                  var node = //some values here , cause its too long I deleted it 
                  foreach (var node in q)
                  {
                      string scity = node.Attribute("CityName").Value.ToUpper(new CultureInfo("tr-TR", false));
                      string ccity = node.Attribute("CityCode").Value;
                      string ccode = node.Attribute("CountryCode").Value;
                      if (ccity != oldcity)
                      {
                          result.Add(new HavaAlani { SehirAdi = scity, HavaAlaniKodu = ccity, HavaAlaniAdi = scity + ", " + ccode, Sehirmi = true });
                          oldcity = ccity;
                      }
                      result.Add(new HavaAlani { SehirAdi = scity, HavaAlaniKodu = node.Attribute("Code").Value, HavaAlaniAdi = node.Value, Sehirmi = false });
                  }
              }
              catch
              {
  
              }
  
              return Json(result, JsonRequestBehavior.AllowGet);
          }
      }
  </code></pre>
  
  <p>My JS :</p>
  
  <pre><code>    $('input.suggestBox').each(function () {
      //$(this).jsonSuggest(air.Lines);
      $(this).autocomplete({
          source: function (request, response) {
              $.ajax({
                  url: "dataAl/GetData",
                  data: { inpt: request.term },
                  dataType: "json",
                  type: "POST",
                  contentType: "application/json; charset=utf-8",
                  dataFilter: function (data) { return data; },
                  success: function (data) {
                      response($.map(data.d, function (item) {
                          return {
                              code: item.HavaAlaniKodu,
                              value: item.HavaAlaniAdi,
                              iscity: item.Sehirmi
                          }
                      }))
                  },
                  error: function (XMLHttpRequest, textStatus, errorThrown) {
                      alert(XMLHttpRequest.responseText);
                  }
              });
          },
          minLength: 2
      }).data("ui-autocomplete")._renderItem = function (ul, item) {
          var cls = "airport";
          if (item.iscity)
              cls = "city";
          return $("&lt;li&gt;&lt;/li&gt;")
                  .data("item.autocomplete", item)
                  .append("&lt;span class='span-" + cls + "'&gt;&lt;/span&gt;")
                  .append("&lt;a class='ui-autocomplete-" + cls + "'&gt;" + item.value + " (" + item.code + ")" + "&lt;/a&gt;")
                  .appendTo(ul);
      };
  
  });
  </code></pre>