• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difference between Add and Get in route

What is the difference between $Routes->get and $Routes->add

(03-03-2020, 02:26 AM)seunex Wrote: What is the difference between $Routes->get and $Routes->add
From what i understand add() just adds a 'universal' route (for get, post etc calls) and get() ads a route for $_GET requests (used with RESTFULL  API for example)

add makes it available across all HTTP verbs, while get will only respond to GET requests. You'll have better security to limit each route only to the HTTP verb that it needs, so I would recommend NOT using add() personally.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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