Angular 9 : php a RESTful CRUD API with HttpClient
one text
l have following php module
uAPIwork.php
<?php $___notjson=1; header('Content-Type: text/html; charset= utf-8');
require 'uAPImodule.php';
$request = new Request(array(
'oauth_consumer_key' => 'check',
'oauth_consumer_secret' => 'fkFNhdbbRENO1GQilHxWvO86QabO6g',
'oauth_token' => 'OfTW8pDo1aIjNvHOdv.nRbZAER5x.LRndWwltepI',
'oauth_token_secret' => '6bnfzAGvMpHpJF1gs9XWqSWGBAdAzdXJWxAj1S..'
));
$response = $request->get('/news', array(
//???�?�?�???�???�?� ???�???�???�?�???�, ?�???�?? ?????�????
));
json_encode($response); //?????�???�?�?�?? ???�???�?�
print_r($response);
?>
Home.ts
request(){
this.http
.get('assets/uAPIwork.php')
.subscribe(res=>{console.log(res)});
}
When i run the code , i have following error:
HttpErrorResponse?�{headers: HttpHeaders, status: 200, statusText: "OK", url: "http://localhost:4200/assets/uAPIwork.php", ok: false,?�??�}
any solution please ?
Source