In angular2 you will call api using http docs here ,
import { Http, Response, Headers } from '@angular/http'; export class ProfileComponent implements OnInit { constructor( private router: Router, private auth: Auth, private http: Http ) { } private personalSubmit() { let headers = new Headers(); headers.append('Content-Type', 'application/json'); return this.http .post('http://localhost:4200/api/apiEndpointURL', this.personal, { headers: headers }) .map((res:Response) => res.json()) .subscribe((res)=>{
This is an example of publishing a form. The values ββare in the form of post , and the answer is console.log to terminal in this case. This is an example of working with the end of node.js. I'm not sure what will need to be changed for php , but in the end you will need an http package . The only thing you may need to change the type of application depending on what you return.
I believe that for php you use this as an application type,
headers.append('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
I found ane xample for php using
source share