[Mapbender_dev] Handling REST API requests.

Karim Malhas karim at malhas.de
Mon Jul 12 02:46:58 EDT 2010


On Mon, Jul 12, 2010 at 07:33:38AM +0200, Armin Retterath <armin.retterath at lvermgeo.rlp.de> wrote
> hello together,
> 
> i would prefer 1)
> cause i think that nice urls are the key for our problems.


What an URL looks like doesn't matter at all for a computer, and
shouldn't for a human - they should be hidden behind the text of a link.

I find clean, nice URLs useful when looking at the locationbar to find
out where I am, or when sharing an URL to serve as a clue as to what
can be expected at that address.
So while I think nice URLs are good, I don't consider them a neccessity.

That said: I read what I wrote again, and I think I wasn't clear enough.
Option 2) uses URLs like "/index.php/user/25" and also easily allows for a
rewrite configuration that can look something like "/user/25"

> 
> regards,
> armin
> 
> Am Sonntag 11 Juli 2010, um 16:32:04 schrieb Karim Malhas:
> > > > 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
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Mapbender_dev mailing list
> > Mapbender_dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapbender_dev
> 
> 
> -- 
> Im Auftrag
> --
> Armin Retterath
> 
> Kompetenz- und Geschäftsstelle Geodateninfrastruktur Rheinland-Pfalz
> beim
> Landesamt für Vermessung und Geobasisinformation Rheinland-Pfalz
> 
> Ferdinand-Sauerbruch-Straße 15
> 56073 Koblenz
> Telefon 0261/492-466
> Telefax 0261/492-492
> armin.retterath at lvermgeo.rlp.de
> http://www.geoportal.rlp.de
> _______________________________________________
> Mapbender_dev mailing list
> Mapbender_dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
> 


More information about the Mapbender_dev mailing list