REST-Api-with-Slim-PHP
REST-Api-with-Slim-PHP copied to clipboard
The value is incorrect in postman.
Hi. When I run http: // localhost / public / webresources / mobile_app / verify, the result of "200 OK" is displayed in RestEasy. However, when running in postman, the status is "401 Unauthorized". What did I do wrong in postman? please answer about my question. Thank you :)
GET: http: // localhost / public / webResources / mobile_app / verify Authorization TYPE: BearerToken Token: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWFkZXIiOnsiaWQiOjEsInVzZXIiOiJ0ZXN0VXNlciJ9LCJwYXlsb2FkIjp7ImlhdCI6IjIwMTktMDEtMDEgMDA6MDA6MDAiLCJleHAiOiIyMDIwLTAxLTAxIDAwOjAwOjAwIn19.RTTPlUqE - WMP9M28-oj7p8MhWdisuuhWBsioDa_bgY
Hi @rocker76,
In this page it is indicated:
Note: NTLM and Bearer token are only available in Postman native apps. All other authorization types are available in Postman native apps and the Chrome app. Note that the Postman Chrome app is being deprecated.
Please tell me the version of postman you are using.
I await for your reply.
Thanks.
It was a problem because there was a gap in the bearer tokens. Resolved.
I have a question. 1.Where are controllers / controller.php used?
Thank you.
In Korea :)
The "controllers/controller.php" has been deprecated for version 1.0.0.5.
Please, see the new version. I upload new features today.
I hope this helpful you :wink:
Thank you for your kind reply. There is one question. :) If I have a lot of generated api, would it be okay to process it within one page of api.php?
If your APIs do not require a specific configuration, you can process all the routes in the same page of api.php and group it like that:
$app->group("/webresources/foo", function () use ($app) {
# code...
});
$app->group("/webresources/bar", function () use ($app) {
# code...
});