title: Wordpress custom REST route giving back 400 Bad Request
body: <p>I am trying to test out a custom REST route in Wordpress. I have the following PHP in my own plugin file:</p>
  
  <pre><code>add_action( 'rest_api_init', function() {
      register_rest_route('tuck-api/v1', '/send_campaign', array(
          'methods' =&gt; 'POST',
          'callback' =&gt; 'campaign_email_route'
      ));
  });
  function campaign_email_route( WP_REST_Request $request ) {
      return json_encode($request-&gt;get_json_params());
  }
  </code></pre>
  
  <p>Right now I just want it to echo back the request body as a test. I am calling it with the following jQuery AJAX request from my plugin in the admin panel:</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: '/wp-json/tuck-api/v1/send_campaign',
      contentType: 'application/json',
      data: {
          recipient: $('.email-recipient').val(),
          campaign_id: campaignList[i].id.toString()
      },
      success: function(res) {
          console.log(res);
      }
  });
  </code></pre>
  
  <p>The console.log in the success callback is what spits out a 400 Bad Request error.</p>