|
I have been using the below listed article [1] to figure out how to pass
parameters to my RPG-CGI program. I have a problem getting the
CONTENT_LENGTH. It always seems to return 0. We are on V5R4.
[1] http://systeminetwork.com/node/26490
P*--------------------------------------------------
P* Procedure name: CgiParseInz
P* Purpose: http://systeminetwork.com/node/26490
P* Returns:
P*--------------------------------------------------
P CgiParseInz B EXPORT
D CgiParseInz PI 10I 0
D cgiBuffer S 4096A
D reqMethod S 10A
D nContentLen S 10I 0
D nBytesRead S 10I 0
D api_error S 64A Inz(*ALLX'00')
/free
reqMethod = %str(getenv('REQUEST_METHOD'));
nContentLen = %int(%str(getenv('CONTENT_LENGTH')));
if (reqMethod = 'POST' and nContentLen > 0);
//if (reqMethod = 'POST');
cgiParse('-i ':'CGII0100': cgiBuffer: %size(cgiBuffer) :
nBytesRead : api_error);
if (nBytesRead > 0);
putenv(%subst(cgiBuffer:1:nBytesRead)); // Set QRY_STR
putenv('REQUEST_METHOD=GET'); // Override method
endif;
endif;
return nBytesRead;
/end-free
P CgiParseInz E
I am claiming stupid here so I am not sure what I maybe doing wrong. I am
using Poster (a Mozilla plugin)(http://code.google.com/p/poster-extension/
)
to test POST to this program.
--
Mike Wills
http://mikewills.info
P: (507) 933-0880 | Skype: koldark
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.