Well using HTTPAPI isn't really living off the land. You're borrowing crops from Scott Klement. Isn't that an added dependency ? 😊
curl is a PASE utility available via IBM.
Not sure what you mean by flimsy and more stable ? Kind of a general comment.
I always look at return code first and then analyze STDOUT/STDERR as necessary or better yet bring that info back to the IBMi calling joblog or a log file.
Same thing when I program for AIX or Linux.
All the QShell and PASE commands act just like their AIX counterparts. Return codes, STDOUT, STDERR and all. So nothing really flimsy or brittle about it.
IMHO of course 😊
Regards,
Richard Schoen
Web:
http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
------------------------------
message: 4
date: Wed, 9 Apr 2025 16:28:51 +0000 (UTC)
from: cesco via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>
subject: Re: Calling Curl from RPG or CL
In any case if the scope of the problem is web services calling in a robust way, I would suggest just go HTTPAPI or the stock DB2 functions already on the system.
------------------------------
message: 2
date: Wed, 9 Apr 2025 19:02:25 +0000 (UTC)
from: cesco via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>
subject: Re: Calling Curl from RPG or CL
The main caveat to your approach is that it assumes the RPG programmer
has all the knowledge
Yep, for sure, approaches may vary rightly so.
I try to live "off the land" with on system tools (stock or IBM repo PASE) as much as possible, to me - IMHO obviously - an added dependency should bring to me a lot of value to justify to introduce it.
I find relying on string output like stderr or stdout of the command for message passing kind of flimsy, especially when such protocol is not meant explicitly to be stable by all the parties involved (i.e. a yum update will bring a new version of the underlying PASE command that change the output formats, language changes...)... usually the return process numeric return code is much more stable and a convention in *nix (AIX) POSIX world to indicate fault conditions...
just my 2c...
As an Amazon Associate we earn from qualifying purchases.