title: How to post json string on some specific url
body: <p>I want to log amplitude on <a href="https://api.amplitude.com/httpapi" rel="nofollow noreferrer">https://api.amplitude.com/httpapi</a> using the following code:</p>
  
  <pre><code>private void LogAmplitude()
  {
      using (var client = new WebClient())
      {
          var url = "https://api.amplitude.com/httpapi";
          client.Headers[HttpRequestHeader.ContentType] = "application/json";
          var model = new { user_Id = "userId", event_type = "Event" };
          var jss = new JavaScriptSerializer();
          var data = jss.Serialize(model);
          string parameters = "api_key=" + "apiKey" + "&amp;event=" + data;
          var response = client.UploadString(url, parameters);
      }
  }
  </code></pre>
  
  <p>But when I run this method it gives me 400(bad request) error. I have tried posting the data using postman through following url:</p>
  
  <pre><code>https://api.amplitude.com/httpapi?api_key=apiKey&amp;event={"user_id":"userId","event_type":"test"}
  </code></pre>
  
  <p>This works totally fine but when I try to post data using the above method it always gives me error. I am not sure what I am doing wrong because I am doing this kind of work for the very first time. So can anybody help?</p>