title: Angular 6 htttp POST - setting params as query string in URL
body: <p>I have an applicataion based on asp .net core boilerplate.
  I need to send http POST parameters from my Angular 6 app.</p>
  
  <p>My service looks like this:</p>
  
  <pre><code>public findProduct(productCode: string) {
  const url_ = 'api/product/findProduct';
  const params = new URLSearchParams();
  params.set('productCode', productCode);
  
  return this.http.post(url_, params, httpHeaders)
    .subscribe(
      result =&gt; {
        console.log(result);
      },
      error =&gt; {
        console.log('There was an error: ')
      }
    );
  </code></pre>
  
  <p>I have imported URLSearchParams from @angular/http, but still I have the same problem. My POST URL is bad, because API expect POST URL like this:
  <strong><a href="http://localhost:21021/api/product/findProduct?productCode=1111" rel="nofollow noreferrer">http://localhost:21021/api/product/findProduct?productCode=1111</a></strong> and query string parameters like:
  <strong>productCode: 1111</strong></p>
  
  <p>but mine looks like this:
  <strong><a href="http://localhost:21021/api/product/findProduct" rel="nofollow noreferrer">http://localhost:21021/api/product/findProduct</a></strong>
  and setting request payload (always empty):</p>
  
  <pre><code>**{rawParams: "", queryEncoder: {}, paramsMap: {}}
  paramsMap: {}
  queryEncoder: {}
  rawParams: ""**
  </code></pre>
  
  <p>My httpHeaders is:
      'Content-Type': 'application/json',
      'Accept': 'text/plain'</p>
  
  <p>My question is how can I set expected API POST parameters in this service?</p>