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
Post a Comment