title: Wordpress process form request from external website by plugin
body: <p>I would like to create an endpoint similar to </p>
  
  <pre><code>http://localhost/wordpress/xxxx/ 
  </code></pre>
  
  <p>that whenever is called is processing POST request.
  So my situation looks like:</p>
  
  <p>Site A Web Form -> User submits data ->
  Wordpress (<code>http://localhost/wordpress/xxxx/</code> ) -> I am parsing and processing request   </p>
  
  <p><strong>How can I achieve it without calling plugin files directly ?</strong> 
  It seems that the simplest way to detect if the 'xxxx' is used as a part of url is to use parse_request:</p>
  
  <pre><code>add_action('parse_request', 'xxxx_parse_request');
  function xxxx_parse_request($wp) {
  
      if (array_key_exists('xxxx', $wp-&gt;query_vars)) {
                          $location =  plugin_dir_url(__FILE__).'includes/issuer_json.php';
                  // process the request.
           wp_redirect($location);
      }
  }
  </code></pre>
  
  <p>but it works only with requests like wordpress?xxxx=1 but not with wordpress/xxxx. I thought that it would work for me and I created a test form to check it. Note that I specify the action of the form to be  <strong><code>http://localhost/wordpress/?xxxx=1</code></strong> and specified a hidden input to test passing the data.</p>
  
  <pre><code>&lt;form action="http://wordpress/?xxxx=1"&gt; 
  &lt;input type="hidden" name="test" value="tes1"/&gt;
  
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Whenever I submit the form, I am redirected to the page with url like: <code>http://wordpress/?test=tes1</code> so the form overwrote the default action <strong><code>http://wordpress/?xxxx=1</code></strong></p>
  
  <p>I am not sure how to deal with the problem. Any help will be appreciated.</p>