perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Wesemann <f.wesem...@fotofinder.com>
Subject Re: Question concerning REST
Date Tue, 25 Aug 2015 11:29:15 GMT
Embperl internally uses CGI.pm to process "data sent to you".
Therefore it can't handle mime types other than multipart/form-data or
application/x-www-form-urlencoded.
I'm even not sure if it can handle HTTP methods other than GET and POST.

2015-08-24 19:05 GMT+02:00 Jean-Christophe Boggio <embperl@thefreecat.org>:

>
> Hello,
>
> I am trying to implement a simple REST/JSON server in embedded perl but I
> don't understand how I can retrieve the data sent to me.
>
> I test with this command :
>
> curl -i -X GET -d '{"name":"john"}' http://omico.miaou/rest/notifent.html
>
>
> And the following code shows nothing (apart from the %ENV stuff) :
>
> [-
> use Data::Dumper;
>
> $req = shift;
>
> while ( ($k,$v) = each(%fdat) ) {
>         warn "$0:FDAT $k : ".Dumper($v);
> }
>
> while ( ($k,$v) = each(%udat) ) {
>         warn "$0:UDAT: $k : ".Dumper($v);
> }
>
> while ( ($k,$v) = each(%ENV) ) {
>         warn "$0:ENV: $k : ".Dumper($v);
> }
>
> foreach $k (@param) {
>         warn "$0:param: $k ";
> }
>
> -]
>
> Thanks for your help,
>
> JC
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>


-- 
-- 
mit freundlichem Gruß,

Frank Wesemann
Fotofinder GmbH         USt-IdNr. DE812854514
Software Entwicklung    Web: http://www.fotofinder.com/
Potsdamer Str. 96       Tel: +49 30 25 79 28 90
10785 Berlin            Fax: +49 30 25 79 28 999

Sitz: Berlin
Amtsgericht Berlin Charlottenburg (HRB 73099)
Geschäftsführer: Ali Paczensky

Mime
View raw message