title: Read POST form in Angular submitted by external websites
body: <p>I am developing a website with Java for the backend and Angular for frontend. There is a situation when some external websites may send data to my website using POST form. For instance,  </p>
  
  <p>▼ <strong>General</strong><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Request URL:</strong> <code>https://myangularwebsite/</code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Request Method:</strong> POST<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</p>
  
  <p>▼ <strong>Request Headers</strong><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Content-Type:</strong> application/x-www-form-urlencoded<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Host:</strong> <code>myangularwebsite</code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Origin:</strong> <code>https://externalwebsite</code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Referer:</strong> <code>https://externalwebsite/send.form?id=0</code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</p>
  
  <p>▼ <strong>Form data</strong><br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>ID:</strong> 0000000<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>TIME:</strong> 2017.06.04 11:53:58<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>SIGNATURE:</strong> ...geirgmGKFGJWR...<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</p>
  
  <p>Now, I need to capture the form in Angular somehow, send/redirect it to the backend to validate the signature and return the answer back to Angular to proceed working with this website.
  I tried posting to my website to test how it might work using Postman, but get <code>Cannot POST /</code>.</p>
  
  <p>I know how to work with GET and URL query parameters in Angular but I think I need to process a POST request based on headers I see with Chrome DevTools 'Network' section when coming from <code>externalwebsite</code> to <code>myangularwebsite</code>.</p>
  
  <p>Should I dedicate a route in the backend and expose it, for example, <code>.../api/external</code> in my backend and tell these websites to use this link instead of directly posting to my Angular website's homepage?</p>
  
  <p>I have already read another question ( <a href="https://stackoverflow.com/questions/42130497/how-to-read-form-post-data-in-angular-2-typescript">How to read form post data in Angular 2 typescript?</a> ) which is somewhat similar but I do not think using PHP is the right way for me as the website I am developing already has an older version written in PHP.</p>