title: send json array to ashx handler
body: <p>I have this code, and when i'm executing it this keeps showing the same error: <strong>Invalid JSON primitive: titles.</strong></p>
  
  <p>Client Side:</p>
  
  <pre><code>        var title = new Array();
  
          ...
  
          for (var i = 0; i &lt; names.length; ++i) {
              title[i] = '{ "titulo' + i + ':"' + names[i] + '"}';
          }
  
          $("#gif").show();
  
          $.ajax({
              async: true,
              contentType: 'application/json; charset=utf-8',
              dataType: 'json',
              type: "POST",
              data: { titles: title },
              url: "../handlers/saveUpload.ashx",
              success: function (msg) {                    
                  $("#gif").hide();
              }
          });
  </code></pre>
  
  <p>Server Side:</p>
  
  <pre><code>        context.Response.ContentType = "application/json";
          var data = context.Request;
          var sr = new StreamReader(data.InputStream);
          var stream = sr.ReadToEnd();
  
          var javaScriptSerializer = new JavaScriptSerializer();
  
          var arrayOfStrings = javaScriptSerializer.Deserialize&lt;string[]&gt;(stream);
  
          foreach (var item in arrayOfStrings)
          {
              context.Response.Write(item);
          }
  </code></pre>
  
  <p>Regards</p>