Hello,
I added the SQL Function QSYS2.HTTP_POST in a RPGLE program.
Exec Sql
values qsys2.http_post(
'http://localhost:8080/api/getDBData',
:vJsonData,
'{"header":"content-type,application/json","header":"content-length, 1000","sslTolerate":"true"}'
) Into :MYCLOB;
I can't use IWS as I need to reuse hundreds of RPGLE program that use standard CGI methodology.
I am unable to return response from the RPGLE called program to fill :MYCLOB variable.
Ctl-Opt Main(Main) openopt(*nocvtdata) option(*noDebugIO:*srcStmt);
Dcl-Proc Main;
Dcl-Pi Main ; // Cannot define a return value due to *RNF3841 compilation error
End-Pi;
// BODY PARSING
// Not working . I had to pass body via environment variable.
Data-Into http_stdin
%data('*STDIN'
:'allowmissing=yes allowextra=yes countprefix=num_ case=any')
%parser('YAJLINTO');
// RESPONSE NOT WORKING
data-gen http_stdout
%data(vJsonVar:'countprefix=num_')
%GEN( 'YAJLDTAGEN'
: '{"write to stdout":true, "http status":200, "include empty arrays": true}');
Giovanni
Comment