title: Pass associative array to PHP API from C#
body: <p>I am working in calling <code>PHP API</code> from <code>c#</code>. But, my problem arise when I have to pass associative array to API. I don't know exact implementation of PHP associative array in C# but I have used dictionary. It didn't works.</p>
  
  <p>I have been using <code>RestSharp</code> to call API.</p>
  
  <p><strong>Code Implemenation:</strong></p>
  
  <pre><code>  var client = new RestClient(BaseUrl);
    var request = new RestRequest(ResourceUrl, Method.POST);
    IDictionary&lt;string,string&gt; dicRequeset = new Dictionary&lt;string, string&gt;
                  {
                      {"request-id", "1234"},
                      {"hardware-id", "CCCCXXX"},
                  };
    request.AddParameter("request", dicRequeset);
    var response = client.Execute(request);
    var content = response.Content;
  </code></pre>
  
  <p><strong>PHP API Implementation(Short):</strong></p>
  
  <pre><code> * Expected input:
   *   string request[request-id,hardware-id]
   * Return:
   *   code = 0 for success
   *   string activation_code
   */
  function activate()
      {
          $license = $this-&gt;checkFetchLicense();
          if (!$license instanceof License) return;
  
          $response = $license-&gt;activate((array)$this-&gt;_request-&gt;getParam('request'));
      }
  </code></pre>
  
  <p>Can someone help me to pass array to PHP API from C#?</p>