title: Web Api - Returning a Dictionary
body: <p>I am unable to successfully return a populated instance of <code>List&lt;StringDictionary&gt;&gt;</code> from Web API Controller to a <code>C#</code> console app. Here are the details...  </p>
  
  <p>Web API Code:</p>
  
  <pre><code>    [HttpPost]
      public async Task&lt;HttpResponseMessage&gt; Get(IEnumerable&lt;long&gt; ids)
      {
              var results = [assume populated instance of List&lt;StringDictionary&gt;&gt;]
  
              return Request.CreateResponse&lt;List&lt;StringDictionary&gt;&gt;(HttpStatusCode.OK, results);
  
      }
  </code></pre>
  
  <p>I have the following client side  code:</p>
  
  <pre><code>        using (var httpClient = new HttpClient { BaseAddress = new Uri(baseAddress) })
          {
  
              var httpResponse = httpClient.PostAsJsonAsync&lt;long[]&gt;("api/promotions", mockIds).Result;
  
              if (httpResponse.IsSuccessStatusCode)
              {
                  var content = httpResponse.Content.ReadAsAsync&lt;List&lt;StringDictionary&gt;&gt;().Result; ***** DOES NOT WORK ****
  
              }
  
          }
  </code></pre>
  
  <p>I get the following error:  </p>
  
  <pre><code>{"Cannot create and populate list type System.Collections.Specialized.StringDictionary. Path '[0]', line 1, position 2."}
  </code></pre>
  
  <p>What obvious fact am I missing here?</p>
  
  <p>UPDATE - what's interesting is if I change StringDictionary to Dictionary it works great.</p>