[Mapbender_dev] Handling REST API requests.
Karim Malhas
karim at malhas.de
Sun Jul 11 10:32:04 EDT 2010
> > You can have a single script for each resource type in the approach I
> > mentioned. Think of it like this
> >
> > api/users.php/json
> > api/user.php/<id>/json
> > api/wms.php/<id>/json>
> >
> > etc.
> >
> >
> Even if it is api/users.php/json
> when the client will send a request GET api/users/json , the server will
> look for api/users/json/index.php or api/users/json/index.html
I don't understand the "GET api/users/json" request, what is that
supposed to get?
Let me try to give a summary of the discussion so far :
1) Map all paths to /index.php and do all the path-parsing there
example: "/user/25" is rewritten to /index.php which can then
parse "/user/25"
advantage: nice URLs
disadvantage: additional configuration in the webserver needed
2)
Give the path as an argument to index.php
example: "/index.php/user/25" will call /index.php which can then
parse "/user/25"
advantage: simple, can be used together with a rewrite
3)
like 2), but for each Resource
there's a ".php" in each url, which could be gotten rid of
with URL rewiriting but it's more work than in 2)
Me my personal preference would be 2)
I would also prefer specify Content-Type as ".json" not "/json", so you
don't have to treat it as a special case in path parsing
Regards,
Karim
More information about the Mapbender_dev
mailing list