[Neko] CGI POST & GET

Alexander Konotop alexander.konotop at gmail.com
Mon Dec 27 20:57:04 CET 2010


Here are my CGI-mode-enabling results for the moment.
changes were made to neko/Web.hx (haXe_v.2.05).

1. Now neko.Web.getParams() and neko.Web.getParamsString() are working
well in GET mode. Changing next lines helped:
-----
Line 349: var a0 = untyped get_env("QUERY_STRING".__s);
Old line 349: var a0 = untyped __dollar__loader.args[0];
Line 370: for( p in a0.split("&") ) {
Old line 370: for( p in a0.split(";") ) {
-----
2. I've tested getting params from stdin in POST mode (works fine) - so
the above two functions surely will work in POST mode too.
3. getClientHeaders(), getParamValues("blah-blah-blah") are not working
at all - do I have to use some untyped neko
4. getMethod always (even when the method is POST) returns "GET". Fixed
changing the line in Web.hx:
-----
Line 380: _get_http_method = function() return untyped
get_env("REQUEST_METHOD".__s);
Old line 380: _get_http_method = function() return untyped "GET".__s;
-----
Seems like "GET" was hard-coded.


So, next my target is to make getParamValues work and to insert
stdin reader into Web.hx to get getParams() working with POST method. If
anybody has any advices - I'll listen/read with pleasure.

In the end I'm expecting to have Web.hx that is working in
ModNeko and CGI modes identically, like PHP now does.



More information about the Neko mailing list