GuzzleHttp Örnek
function apiClient() {
$response = $this->client->request('GET', $this->baseApiURL .$this->apiURL,
[
'headers' => ['Authorization' => 'Bearer '.$this->token],
'verify' => false
]
);
return json_decode($response->getBody(), true);
}
AngularJS Örnek
return $http({
method: 'GET',
headers: {
"authorization": "Bearer " + $window.localStorage.getItem('token'),
"content-type": "application/json",
"accept": "application/json"
},
url: $rootScope.serviceBaseURL + 'BilesikKutukSorgulaKimlikNoServis/'+id
}).success(function (data, status) {
console.log(data);
}).error(function (data, status) {
console.log("Hata: " + JSON.stringify({ data: data }));
});