I have rest call like below. Its like cross domain. I want to call the php file which is in the same project folder. But I am getting 404 error. I can able to download the file using error link. That means link what I am giving is correct.
return this._http
.post('/app/php/reports.php', data.toString(), {headers: this.headers})
.toPromise()
.then(res => res.json().data)
.catch(this.handleError);
Header is defined below. private headers = new Headers({'Content-Type': 'application/json'});
Imported files are listed below
import { Headers, Http, Response } from '@angular/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
Is there any dependencies for npm server to call the php file. I have updated the node sever with "sudo npm install php-embed" Still I am facing this issue. I hope its a problem with node server to call the .php file. I can able to call the xml file using get request. Here I want to post the data to php file.