title: How to send data to the ASP.NET Core MVC controller in C#?
body: <p>I am trying to send data from my Javascript to my post method controller. I have knockout as my method to bind from Javascript to my view.</p>
  <p>This is my controller, and this is wher convocationData is null</p>
  <pre><code>public async Task&lt;ActionResult&gt; CreateConvocation(string convocationData)
  {
      string baseUrl = &quot;http://localhost:8080&quot;;
      HttpClient client = new HttpClient();
      client.BaseAddress = new Uri(baseUrl);
  </code></pre>
  <p>This is how I try to call the method using jQuery:</p>
  <pre><code>var tmpSession = self.addSession();
  var tmpDescription = self.addDesc();
  var convocationData = {
              sessionCode: tmpSession,
              description: tmpDescription
          };
  
  $.ajax({
              url: '/Convocations/CreateConvocation',
              type: 'POST',
              dataType: 'json',
              data: JSON.stringify(convocationData),
              contentType: 'application/json',
              success: function (data) {
                  self.Convocations.push(new Convocation(self.addSession(), self.addDesc()));
                  self.addDesc(&quot;&quot;);
                  self.addSession(&quot;&quot;);
              },
              error: function (err) {
                  alert(err.status + &quot; : &quot; + err.statusText);
              }
          });
  </code></pre>