title: how do i fix 400 (Bad Request) error about admin-ajax.php
body: <p>I want to deliver html value through JS to PHP handling, but I still got error, 400 (Bad Request) .</p>
  <p>This is HTML:</p>
  <pre><code>&lt;/div&gt;
              &lt;form class=&quot;row g-3&quot; id=&quot;my_form&quot;&gt;
                &lt;div class=&quot;col-md-12&quot;&gt;
                  &lt;label for=&quot;url&quot; class=&quot;form-label&quot;&gt;Input URL&lt;/label&gt;
                  &lt;input type=&quot;text&quot; class=&quot;form-control my_info&quot; id=&quot;url&quot; required&gt;
          
                &lt;div class=&quot;col-12&quot;&gt;
                  &lt;button class=&quot;btn btn-primary submit&quot; type=&quot;button&quot;&gt;Submit form&lt;/button&gt;
                &lt;/div&gt;
              &lt;/form&gt;
     &lt;/div&gt;
  </code></pre>
  <p>This is JavaScript:</p>
  <pre><code>function getBaseUrl() {
      var re = new RegExp(/^.*\//);
      var my_local_url = re.exec(window.location.href)[0];
  
      return my_local_url;
  }
  
  console.log(getBaseUrl())
  
  jQuery(document).ready(function($) {
      console.log('test');
      // We'll pass this variable to the PHP function example_ajax_request
      var my_data = {
          'action':'crawler_info',
          'my_info' : document.getElementById('url').value
      };
      $('.submit').click(function (){
          // This does the ajax request
          $.ajax({
              url: getBaseUrl() + 'admin-ajax.php',
              data: my_data,,
              success:function(data) {
                  // This outputs the result of the ajax request
                  console.log(data);
              },
              error: function(errorThrown){
                  console.log(errorThrown);
              }
          }); 
      })
  });
  </code></pre>
  <p>This is PHP:</p>
  <pre><code>function get_info() {
  
      // The $_REQUEST contains all the data sent via ajax 
      if ( isset($_REQUEST) ) {
  
          $infos = $_REQUEST['my_info'];
  
          // Now we'll return it to the javascript function
          // Anything outputted will be returned in the response
          echo $infos;
  
          // If you're debugging, it might be useful to see what was sent in the $_REQUEST
          print_r($_REQUEST);
  
      }
  
      // Always die in functions echoing ajax content or it will display 0 or another word
     die();
  }
  
  add_action( 'wp_ajax_crawler_info', 'get_info' );
  add_action( 'wp_ajax_nopriv_crawler_info', 'get_info' );
  </code></pre>
  <p>I have try many way to fix it, but it still display this error again.
  Does anybody know how to solve my problem,Thanks</p>