Angular 6 :
import {Injectable} from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable()
export class GetData {
constructor( private http: HttpClient ) { }
post( ) {
data = [ {username : 'test',password : '1234' }];
return this.http.post('login.php' , data );
}
}
PHP : login.php
<?php
$username = $_POST['username'];
$password = $_POST['password'];
?>
How can i get data from Angular 6 that is [Object] into $username , $password
**
"$_POST" and "$_REQUEST" is not available for me.
**