Friday, 6 September 2013

Exposing php functions/library as API in php

Exposing php functions/library as API in php

I have a library say something like this
function createCompany($json) {
...
}
function readCompany($json) {
...
}
function updateCompany($json) {
...
}
I want to expose them over an API say in the following format
http:// ... /api/api.php?fxn=updateCompany&jsn={"somejson":true}
http:// ... /api/api.php?fxn=readCompany&jsn={"somejson":false}
Is there a direct way were I can directly expose the above methods as API.

No comments:

Post a Comment