POST https://omuservices.omu.edu.tr/login
GuzzleHttp Örnek
function getJWTToken() {
$response = $this->client->request('POST', $this->baseApiURL .'login',
[
'form_params' => ['email' => $this->email, 'password' => $this->password],
'verify' => false
]
);
$token = json_decode($response->getBody(), true);
return $this->token = (isset($token['token'])?$token['token']:'');
}
AngularJS Örnek
myobject = { 'email': Users.email, 'password': Users.password };
return $http({
method: 'POST',
headers: {
"content-type": "application/json",
"accept": "application/json"
},
url: $rootScope.serviceBaseURL + 'login',
data: myobject
}).success(function (data, status) {
tokenPayload = jwtHelper.decodeToken(data.token);
$window.localStorage.setItem('token', data.token);
}).error(function (data, status, headers, config) {
console.log("Hata: " + JSON.stringify({ data: data }));
});