Welcome Guest, Not a member yet? Register   Sign In
Difference between Add and Get in route
#1

(This post was last modified: 03-03-2020, 02:27 AM by seunex.)

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

(This post was last modified: 03-03-2020, 01:05 PM by Hielemedia.)

(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)
Reply
#3

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB