Re: URL with parameters in NetCGI

Gerd Stolpmann <[email protected]> Wed, 05 Mar 2014 13:09:28 +0100
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <1394021368.3115.5.camel@e130>
--===============4132522289182818988==
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature"; 
	boundary="=-LdMTMfJuy0q/elAyOOWO"


--=-LdMTMfJuy0q/elAyOOWO
Content-Type: text/plain; charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Hi,

accessing the path is already possible. For example, if you bind the cgi
to /service_name, and enter /service_name/some/path in the browser, you
get the "excess part" of the path in cgi#environment#cgi_path_info, i.e.
"/some/path". This should work for all cgi connectors in the same way
(this behavior is part of the CGI standard). You could then split the
path into components and process as you like.

Does this help?

Gerd

Am Dienstag, den 04.03.2014, 16:18 +0100 schrieb Pierre-Alexandre Voye:
> HI,
>=20
>=20
> As far I understand my use of NetCGI, it only allow GET/POST/... URLs
> with parameters like :
>=20
> /service_name?param1=3Done&param2=3Dtwo
>=20
>=20
>=20
>=20
> It's now usual, according to REST philosophy, to write URLs as
> follow :
>=20
> GET /table_name/17
>=20
> PUT /table_name/17
>=20
> and of course more complex URLs as :
>=20
> PUT /publishers/1/magazines/2/photos/3
>=20
>=20
> However there's ocaml's library to do that (aka
> https://github.com/rgrinberg/opium which user cohttp based on
> Lwt/Async), NetCGI is so powerful and multicore ready that I would
> prefer to use it.
>=20
> With opium you can format your URLs as follow :
> let print_person =3D get "/person/:name/:age" ...
>=20
>=20
>=20
>=20
> So, is there a way to do that with NetCGI ? Or, if I want to
> contribute by coding it, what, Gerd, would be the way you prefer to
> patch NetCGI ?
>=20
>=20
>=20
> Regards,
>=20
>=20
> Pierre-Alexandre
>=20
>=20
>=20
>=20
>=20
> --=20
> ---------------------
> https://twitter.com/#!/ontologiae/
> http://linuxfr.org/users/montaigne
>=20
> -------------------------------------------------------------------------=
-----
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perf=
orce.
> With Perforce, you get hassle-free workflows. Merge that actually works.=
=20
> Faster operations. Version large binaries.  Built-in WAN optimization and=
 the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=3D122218951&iu=3D/4140/ostg=
.clktrk
> _______________________________________________ Ocamlnet-devel mailing li=
st [email protected] https://lists.sourceforge.net/lists=
/listinfo/ocamlnet-devel

--=20
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    [email protected]
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------


--=-LdMTMfJuy0q/elAyOOWO
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAABAgAGBQJTFxP4AAoJEAaM4b9ZLB5TEeYH/i+BaVOV33YwnrmL6Hy+ClnU
WiYNTXhpIpHl/FLlaWSWCy03xzZQwc53Z7ttLFH9mElrIRagVMF8WI9o1bost2DW
M9di8lt+SI5eczJm7Yaphft4SPspUz0I3NbRdvGBeYVj4sQYhVsbBoTd6D/XFOOK
CggGp3OiF+LE3/x1OX8i1yuiFj+wb1DWPpH+PYgnlPnOJf5DVcCh++j5Z/duaOaw
2DowaTT3xLNqC/nI8Zg/iCdcNGApiL1TkWPZ+uDl6/0x4opkzGPAE9F3WWcY+yFb
5GEe1pOIMg64RTwjBwmdAS+xk9HHCK0PHZP+e3I7JK8nCRVLdV6guP69GOuXWgs=
=wfzK
-----END PGP SIGNATURE-----

--=-LdMTMfJuy0q/elAyOOWO--



--===============4132522289182818988==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
--===============4132522289182818988==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ocamlnet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel

--===============4132522289182818988==--