Re: Help receiving JSON into CGI program
Jon Paris <[email protected]>
| Newsgroups | gmane.comp.systems.as400.web |
|---|---|
| Message-ID | <[email protected]> |
Are you using the native APIs? CGIDEV2? What does you Apache configuration look like? etc. etc. That's what I was alluding to. Your data appears to be URL encoded - so was the JSON payload in the URL rather than the body? Have you looked at the examples Scott provides in his presentation on using RPG to provide web services ? https://www.scottklement.com/presentations/Providing%20RPG%20Web%20Services%20on%20IBM%20i.pdf <https://www.scottklement.com/presentations/Providing%20RPG%20Web%20Services%20on%20IBM%20i.pdf> Jon P. > On Apr 12, 2022, at 9:12 AM, Alvin Strasburger <[email protected]> wrote: > > Jon, > How to receive the JSON is our exact problem. We can parse a JSON-like > string perfectly with DATA-INTO using a test string in our program. Our > issue is the front end of how to receive the 'decoded' JSON doc. Our past > experience is receiving comma delimited strings with no other punctuation or > blanks. Now with trying to receive names and addresses, we end up getting an > address element like 200%20MAIN%20ST instead of 200 MAIN ST. So in short, we > don't really understand how to get the decoded JSON doc to the RPG/YAJL > parser from the CGI interface. > > Alvin > Alvin Strasburger > Printgear Sportswear > Phone 803-744-2310 > Toll Free 800-763-7763 > mailto:[email protected] > www.printgear.com > > > -----Original Message----- > From: WEB400 [mailto:[email protected]] On Behalf Of Jon > Paris > Sent: Monday, April 11, 2022 6:15 PM > To: Web Enabling the IBM i (AS/400 and iSeries) > Subject: Re: [WEB400] Help receiving JSON into CGI program > > It would be good if you told us what you _have_ already tried code wise. > How are you receiving the JSON? > > > Jon P. > >> On Apr 11, 2022, at 4:56 PM, Alvin Strasburger <[email protected]> > wrote: >> >> We have been providing some web services by receiving simple not >> encoded comma delimited lists in CGI programs and responding with >> Scott Klement's version of YAJL. This has been working well for us for > several years. >> >> >> >> Now we need to do a few more complicated things including receiving >> names and addresses with spaces and punctuation. We found in testing >> that these fields come to our RPG program encoded. We thought that if >> the data was sent as a JSON payload that we could then process it. >> However, we don't really understand how to get the decoded JSON >> payload from the web to our RPG program We have done significant >> research, but are not really web programmers. Can someone offer us a >> solution or maybe share a configuration and/or a program where a JSON >> payload is successfully passed to RPG from CGI? >> >> >> >> Thanks, >> >> Alvin >> >> Alvin Strasburger >> >> Printgear Sportswear >> >> Phone 803-744-2310 >> >> Toll Free 800-763-7763 >> >> <mailto:[email protected]> mailto:[email protected] >> >> <http://www.printgear.com/> www.printgear.com >> >> >> >> >> >> -- >> This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) >> mailing list To post a message email: [email protected] To >> subscribe, unsubscribe, or change list options, >> visit: https://lists.midrange.com/mailman/listinfo/web400 >> or email: [email protected] Before posting, please >> take a moment to review the archives at >> https://archive.midrange.com/web400. >> > > -- > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing > list To post a message email: [email protected] To subscribe, > unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/web400 > or email: [email protected] Before posting, please take a > moment to review the archives at https://archive.midrange.com/web400. > > -- > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/web400 > or email: [email protected] > Before posting, please take a moment to review the archives > at https://archive.midrange.com/web400. > -- This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/web400 or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/web400.