REST-Api-with-Slim-PHP icon indicating copy to clipboard operation
REST-Api-with-Slim-PHP copied to clipboard

The value is incorrect in postman.

Open rocker76 opened this issue 6 years ago • 5 comments

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

rocker76 avatar Jan 22 '19 09:01 rocker76

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.

ManuelGil avatar Jan 24 '19 03:01 ManuelGil

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 :)

rocker76 avatar Jan 24 '19 03:01 rocker76

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:

ManuelGil avatar Jan 25 '19 02:01 ManuelGil

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?

rocker76 avatar Jan 30 '19 01:01 rocker76

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...
});

ManuelGil avatar Feb 03 '19 18:02 ManuelGil