title: How to receive a Json array in asp.net
body: <p>I have an asp.net webserver that I am using to try and receive data from a client in the form of a Json array.  A small example:</p>
  
  <pre><code>[{"Event":"Connect","Result":"Success"}]
  </code></pre>
  
  <p>Trying a test run though through POSTMAN I receive a 500 error.
  <br></p>
  
  <blockquote>
    <p>{
        "Message": "Type 'System.Collections.Generic.IDictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not supported for deserialization of an array.",
        "StackTrace": "   at System.Web.Script.Serialization.ObjectConverter.ConvertListToObject(IList list, Type type, JavaScriptSerializer serializer, Boolean throwOnError, IList&amp; convertedList)\r\n   at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object&amp; convertedObject)\r\n   at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object&amp; convertedObject)\r\n   at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)\r\n   at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)",
        "ExceptionType": "System.InvalidOperationException"
    }</p>
  </blockquote>
  
  <p>I have tried calling an empty web method and I am still receiving the error which is throwing me off since I havent done anything with the object yet.<br>
  Here are the two methods I have tried calling, the first one is just an empty method, the second is what I was using before I found out I needed to receive a json array.</p>
  
  <pre><code>[WebMethod(Description = "test")]
  public void TEST()
  {
  
  }
  </code></pre>
  
  <p><br></p>
  
  <pre><code>[WebMethod(Description="Webhook")]
  public void Webhook()
  {
      string message = null;
      var req = new StreamReader(HttpContext.Current.Request.InputStream);
      req.BaseStream.Seek(0, SeekOrigin.Begin);
      string body = req.ReadToEnd().ToString();
      // Parse through json object and do things
  }
  </code></pre>