You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Dirk Melchers <me...@nureg.de> on 2017/12/20 12:06:40 UTC

Creating an API with Embperl and POST Requests

Hello,

we try to create an API solution with Embperl. We receive a JSON structure send vie POST.

The problem: there is nothing stored in %fdat. I think it is skipped, because the POST data are not in the form "KEY=VALUE" but it's only a JSON structure.

Is there a way to access the POST body in an embperl template?


And, just to be safe: does Embperl handle the other HTTP methods (PUT, DELETE, PATCH,...) or will there be the next problem?


With best regards,

Dirk Melchers
/// IT/Software-Development ///

NUREG GmbH ///
Dorfäckerstraße 31 | 90427 Nürnberg | Germany
Tel. +49-911-32002-256 | Fax +49-911-32002-299
Mobil +49-172-9354670 | www.nureg.de
Nürnberg HRB 22653 | USt.ID DE 814 685 653
Geschäftsführer: Michael Schmidt, Stefan Boas


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


SOLVED: Re: Creating an API with Embperl and POST Requests

Posted by Dirk Melchers <me...@nureg.de>.
Hello again,

after reading a lot of "nice" embperl internal sourcecode (there are some things you definitely don't want to do...), I found 

$request->param-> query_info

in the documentation...

... which was exactly what we needed :-)


I wish you all very nice christmas days!

With best regards,

Dirk Melchers
/// IT/Software-Development ///

NUREG GmbH ///
Dorfäckerstraße 31 | 90427 Nürnberg | Germany
Tel. +49-911-32002-256 | Fax +49-911-32002-299
Mobil +49-172-9354670 | www.nureg.de
Nürnberg HRB 22653 | USt.ID DE 814 685 653
Geschäftsführer: Michael Schmidt, Stefan Boas

> Am 20.12.2017 um 13:06 schrieb Dirk Melchers <me...@nureg.de>:
> 
> Hello,
> 
> we try to create an API solution with Embperl. We receive a JSON structure send vie POST.
> 
> The problem: there is nothing stored in %fdat. I think it is skipped, because the POST data are not in the form "KEY=VALUE" but it's only a JSON structure.
> 
> Is there a way to access the POST body in an embperl template?
> 
> 
> And, just to be safe: does Embperl handle the other HTTP methods (PUT, DELETE, PATCH,...) or will there be the next problem?
> 
> 
> With best regards,
> 
> Dirk Melchers
> /// IT/Software-Development ///
> 
> NUREG GmbH ///
> Dorfäckerstraße 31 | 90427 Nürnberg | Germany
> Tel. +49-911-32002-256 | Fax +49-911-32002-299
> Mobil +49-172-9354670 | www.nureg.de
> Nürnberg HRB 22653 | USt.ID DE 814 685 653
> Geschäftsführer: Michael Schmidt, Stefan Boas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org