Answer the question
In order to leave comments, you need to log in
php. How to pass api kosher?
I am working on implementing some API using php. My question arose in how it is more correct (for example, from the point of view of most frameworks) to pass parameters.
In T.Z. I now have it like this:
method GET, <sitename>/api?users <--получить всех юзереов;
method GET, <sitename>/api?groups <--получить все группы;
method GET, <sitename>/api?file <--получить file;
method GET, <sitename>/api?filerem <--delete file;
method GET, <sitename>/api?fileinfo <--return file info;
method GET, <sitename>/api?groupsANDusers <--return groups and users;
method GET, <sitename>/api?tymeStamp <--get user documents after that time;
...
method POST, <sitename>/api?user <--createNewUser;
method POST, <sitename>/api?group <--add new group;
method POST, <sitename>/api?file <--upload file;
...
switch case
. But mvc tells me that if the request looked like this:<sitename>/api/post/group/2;
<sitename>/api/get/documentInfo/id/123123123;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question