atk4 / api

Implementation of RestAPI for Agile Data
https://agiletoolkit.org/
14 stars 12 forks source link

URL params (?param1=somevalue) mess up rest patterns #14

Open PhilippGrashoff opened 5 years ago

PhilippGrashoff commented 5 years ago

Hi, when passing URL params to the api, the Api->rest() does not work as supposed. Furthermore, if the last part of the pattern is a variable (e.g. :id), the URL params are added to this variable

pattern setup: 
$this->rest('/bookings', new Booking($this->app->db));

This request is not recoqnized:
www.mydomain.com/api/bookings?access_token=123456

DELETE www.mydomain.com/api/bookings/3?access_token=123456
=> id which should be 3 becomes 3?access_token=123456

My proposal:

DarkSide666 commented 5 years ago

Can you make PR please?