title: Ionic issue with HttpClient.post (No 'Access-Control-Allow-Origin' header is present)
body: <p>Well, I've tried to send a post request from <em>HttpClient</em> class in <em>Ionic3</em>, in the next code fragment I show the function in TypeScript.</p>
  
  <pre><code>constructor(public http: HttpClient, ...){ ... }
  
  loginAndGetUserData(email0, password0): any
  {
      return this.http.post
      (
          'http://xxx.a_api/api/login.json',
          {
              email: email0,
              password: password0
          },
          {
              headers:
              {
                  'Access-Control-Allow-Origin':'*',
                  'Access-Control-Allow-Methods':'POST, GET, OPTIONS, PUT',
                  'Content-Type':'application/json',
                  'Accept':'application/json'
              }
          }
      );
  }
  </code></pre>
  
  <p>Then, when I call this method I receive an error with undefined code as response.</p>
  
  <blockquote>
    <p>ErrorCode: undefined<br />
    Http failure response for (unknown url): 0 Unknown Error</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/gyQku.png" rel="nofollow noreferrer">Capture image of device</a></p>
  
  <p><br />In Android logs, after the function call, I get this message:</p>
  
  <blockquote>
    <p>08-09 21:16:31.649 19292-19292/io.ionic.starter D/SystemWebChromeClient: <a href="http://localhost:8080/" rel="nofollow noreferrer">http://localhost:8080/</a>: Line 0 : XMLHttpRequest cannot load <a href="http://xxx.a_api/api/login.json" rel="nofollow noreferrer">http://xxx.a_api/api/login.json</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>' is therefore not allowed access. The response had HTTP status code 405.<br />
    08-09 21:16:31.649 19292-19292/io.ionic.starter I/chromium: [INFO:CONSOLE(0)] "XMLHttpRequest cannot load <a href="http://xxx.a_api/api/login.json" rel="nofollow noreferrer">http://xxx.a_api/api/login.json</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>' is therefore not allowed access. The response had HTTP status code 405.", source: <a href="http://localhost:8080/" rel="nofollow noreferrer">http://localhost:8080/</a> (0)<br /></p>
  </blockquote>
  
  <p>And in my PHP code I tried to put 'Access-Control-Allow-Origin:*' in header, but It receive empty data from the client. In some <em>Ionic</em> forum some people say that I have to modify <em>ionic.config.json</em> file putting <em>proxies</em> attribute with <em>path</em> and <em>proxyUrl</em>, but neither It resolve my issue.<br /><em>proxies</em> attribute, in <em>ionic.config.json</em> file, looks like:</p>
  
  <pre><code>"proxies":
  [
      {
          "path": "/api",
          "proxyUrl": "http://xxx.a_api/api"
      }
  ]
  </code></pre>
  
  <p>Well, I don't know what to do, I'm sure that It's a client problem, 'cause the server receive empty data.
  Thanks in advance.</p>