Question on upgrading from Ver 1.24 to newest 1.45

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
wsbaggett
Posts: 4
Joined: Fri Aug 05, 2022 5:10 pm

Question on upgrading from Ver 1.24 to newest 1.45

Post by wsbaggett »

I'm new to my current RPGLE developer position with my current employer....and have been tasked with changing the way we get responses back from a client API in JSON instead of XML. A previous developer loaded Scott's HTTPAPI open source code several years ago to get the response in a RPGLE program in XML and it has been work untouched since then....it is Ver 1.24 I'm reading that I need to use one of the new features such as HTTP_req() or HTTP_string() to retrieve the response back from the client's API and then use Scott's Yajl open source (I have already downloaded the Yajl code and placed on the AS400/iSeries) to parse it into a RPGLE DS...using something like this from one of Scott's examples:

Code: Select all

jsonData = http_string( 'GET': BASEURL);

data-into cust %DATA( jsonData
                      : 'case=convert countprefix=num_')
                      %PARSER('YAJLINTO’);
I haven't been able to find any specific instructions on how I should upgrade from HTTPAPI Ver 1.24 to 1.45....I don't want to hose up anything that is currently working until I can get the new JSON process working. Any suggestions?
Scott Klement
Site Admin
Posts: 636
Joined: Sun Jul 04, 2021 5:12 am

Re: Question on upgrading from Ver 1.24 to newest 1.45

Post by Scott Klement »

You can simply delete your current HTTPAPI installation and install the new one.

Or, if you are worried about a problem, you can install the new one in a different library and adjust your library list to use the new one. Test your software, if it doesn't work, put the old one back in your library list.
wsbaggett
Posts: 4
Joined: Fri Aug 05, 2022 5:10 pm

Re: Question on upgrading from Ver 1.24 to newest 1.45

Post by wsbaggett »

Thanks so much Scott. I think I'll will get our SysAdmin to install the new version in a different Lib like you suggested...just in case the previous old install has any customization that was done over it without being documented.

Again thanks for your coding effort in making a work around for the iSeires that includes the HTTPAPI and YAJL open source...saves the rest of us many hours of coding and headaches.
wsbaggett
Posts: 4
Joined: Fri Aug 05, 2022 5:10 pm

Re: Question on upgrading from Ver 1.24 to newest 1.45

Post by wsbaggett »

Scott,

Since I'm going to install the new 1.45 version in a different Lib...for testing reasons. Your notes say to:

Tip: If you want to use a different library name aside from LIBHTTP, open the INSTALL member of the QCLSRC file and change the &SRCLIB and &INSTLIB variables.

My question is do I also need to change the &BINDLIB that is hard coded in the Install CL Source to the name of the different Lib name other than LIBHTTP? I'm assuming so, but want to make sure before I change it as well.

DCL VAR(&BINDLIB) TYPE(*CHAR) LEN(10) +
VALUE('LIBHTTP')

I want to make sure all the Lib vars are pointing to the new/different one that will have the newer 1.45 version.

Thanks for your help.
Scott Klement
Site Admin
Posts: 636
Joined: Sun Jul 04, 2021 5:12 am

Re: Question on upgrading from Ver 1.24 to newest 1.45

Post by Scott Klement »

When you call the INSTALL program, it should ask you about the libraries to use. You can change them in the code if you want, too.. but it'll ask you on the screen.

Most of the time, people want to use *LIBL for the &BINDLIB so that it uses whichever copy of HTTPAPI is in your library list. But, some shops don't like to have to add it to their library list, so they'll hard code a library instead. The problem with that it is makes it difficult to test different versions (like you're doing.) So I would recommend using library list.
wsbaggett
Posts: 4
Joined: Fri Aug 05, 2022 5:10 pm

Re: Question on upgrading from Ver 1.24 to newest 1.45

Post by wsbaggett »

Thanks so much for the help Scott.
Post Reply