title: 400 Bad Request when POST-ing to Razor Page
body: <p>My page has...</p>
  
  <pre><code>@page "{candidateId:int}"
  </code></pre>
  
  <p>... and</p>
  
  <pre><code>@Html.AntiForgeryToken()
  </code></pre>
  
  <p>Model has...</p>
  
  <pre><code>public void OnGet(int candidateId)
  {
  
  }
  
  public void OnPost(int candidateId)
  {
  
  }
  </code></pre>
  
  <p>GET works fine. Here is my AJAX request..</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "/Skills/" + candidateId,
      beforeSend: function (xhr) {
  
          xhr.setRequestHeader("XSRF-TOKEN",
              $('input:hidden[name="__RequestVerificationToken"]').val());
      },
      data: {
  
          name: 'hi mum'
      },
  
      success: function (response) {
      },
      failure: function (response) {
  
          alert(response);
      }
  });
  </code></pre>
  
  <p>Browser receives useless error message... 400 Bad Request.</p>
  
  <p>What am I missing?</p>