php - ZF2 & Apigility - Correct way to setup GET and POST RPC services -


what correct way setup , post services in apigility?

currently, if setting service, include variable require in route:

/api/verify/merchant[/:merchant_code]

and if wish setup post service, route becomes:

/api/verify/merchant

and add merchant_code 'field'

and if want route accept both post , get, this:

/api/verify/merchant[/:merchant_code]

and add merchant_code field well...

is correct way setup routing this?

in general post new entities on collection endpoint in case /api/verify/merchant. server respond new resource self href newly created merchant. href formatted /api/verify/merchant[/merchant_code] merchant_code identifier newly added merchant resource.

sending post request /api/verify/merchant[/merchant_code] not necessary/valid. get, patch, delete or put requests on endpoint of merchant resource depending on action want perform (read, update, delete, replace).


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -