I am new to creating leisure api.
I want to know how rest api routing works. I have an api that works in one routing and not in another. What exact changes do I need to make in order to bind each api call to a specific VERB.
for example, I want / customer / view, which is called only by the GET verb, put and post cannot make this call, is this possible with route settings
here are my routes ..
which works here:
'<controller:\w+>' => '<controller>/list',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
'<controller:\w+>/<id:\d+>/<title>' => '<controller>/view',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
The one that doesn't work is ... especially the kind that is called like that, basically I can call it from any VERB, how to attach to a specific verb
https://myipaddress/wiz-frontend-himanshu/customer/view/?id=test
recreation routes
array('customer/list', 'pattern'=>'customer/<model:\w+>', 'verb'=>'GET'),
array('customer/view', 'pattern'=>'customer/<model:\w+>/<id:\w+>', 'verb'=>'GET'),
array('customer/update', 'pattern'=>'customer/<model:\w+>/<id:\d+>', 'verb'=>'PUT'),
array('customer/delete', 'pattern'=>'customer/<model:\w+>/<id:\d+>', 'verb'=>'DELETE'),
array('customer/create', 'pattern'=>'customer/<model:\w+>/<id:\d+>', 'verb'=>'POST'),
Can someone explain what this template does for sure, and what changes do I need to make to trigger my view call