• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is Codeigniter 4 supports "Verb Based Routing"?

GET         /api/order      Returns all orders
GET         /api/order/3   Returns details order #3
POST       /api/order     Create new order
PUT         /api/order/3   Update order #3
DELETE   /api/order/3   Delete order #3

The above is considered verb-based routing. The URLs above only contain the controller name and an optional id. So the Web API uses the HTTP verb of the request to determine the action method to execute in your ApiController subclass.

according to CI4 documentation, it is possible (https://bcit-ci.github.io/CodeIgniter4/g....html#id14)

CodeIgniter 4 Development Users Guide - Using HTTP verbs in routes
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

Users browsing this thread:
1 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.