title: Pass two JSON object by web client post method C#
body: <p>I need to pass below object as a parameter for a post method using web client method in C#. </p>
  
  <pre><code>     {
      "company":
      {
          "id": "e63dfcab345260b2591f585126ede56627db4ef2"
      },
      "requestor":
      {
          "id": "",
          "email": "customer@example.com ",
          "firstName": "Test",
          "lastName": "Requestor",
          "role": "employerAdmin",
          "phone": "(415)1112222",
          "title": "HR Manager"
      }
  }
  </code></pre>
  
  <p>I converted like this</p>
  
  <pre><code>company[id]=e63dfcab345260b2591f585126ede56627db4ef2&amp;requestor[id]=&amp;requestor[email]=customer@example.com+&amp;requestor[firstName]=Test&amp;requestor[lastName]=Requestor&amp;requestor[role]=employerAdmin&amp;requestor[phone]=(415)1112222&amp;requestor[title]=HR+Manager
  </code></pre>
  
  <p>But i am getting invalid parameter error. Please help me. Thanks in advance.</p>
  
  <p>My entire code is below:</p>
  
  <pre><code> using (var Requestor = new System.Net.WebClient())
              {
  
                  string url = "https://stormaas-pre.inflection.com:8443/v1/Requestor?";
                  string parameters = "company[id]='757563a3-67df-4a6e-9ef9-d89d57d41e0d'&amp;requestor[id]=''&amp;requestor[email]='customer@example.com'&amp;requestor[firstName]='Test'&amp;requestor[lastName]='Requestor'&amp;requestor[role]='employerAdmin'&amp;requestor[phone]='(415)1112222'&amp;requestor[title]='HRManager'";
                  Requestor.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
                  Requestor.Credentials = new System.Net.NetworkCredential("xyz:xyz!", "");
                  Requestor.Encoding = System.Text.Encoding.UTF8;
                  Requestor.Headers[HttpRequestHeader.ContentType] = "application/json";
                  Requestor.Headers[HttpRequestHeader.Accept] = "text/xml";
                  string res = Requestor.UploadString(url, "POST", parameters);
              }
  </code></pre>