Use Richard Schoen's QshOni : [1]
https://github.com/richardschoen/QshOni
Here's an example I use to Validate Addresses using UPS Onlline Tools:
// Build cURL Command to Validate Address
cmdlne='QSHONI/QSHCURL CMDLINE(' + Qt + ' -X POST ' +
DQ +'
https://onlinetools.ups.com/api/addressvalidation/v1/3' +
'?regionalrequestindicator=False&maximumcandidatelistsize=15' + DQ +
' -H '+Qt+Qt+ 'Authorization: Bearer ' + %trim(token) +Qt+Qt+
' -H '+Qt+Qt+ 'Content-Type: application/json' +Qt+Qt+
' -d '+QT+QT+ %trim(xavrequest) +QT+QT+
' -o ' + %trim(fname) +Qt+ ') ' +
'SETPKGPATH(*YES) DSPSTDOUT(*NO) LOGSTDOUT(*NO) ' +
'PRTSTDOUT(*NO)';
// Run QSHCURL command and handle any errors nicely.
monitor;
qcmdexc(%trim(cmdlne):%len(%trim(cmdlne)));
cmdError=0;
on-error;
cmdError=1;
endmon;
// If errors, exit the program
if cmdError = 1;
Dsply 'cURL Command Ended with Errors';
Dump(A);
*inlr=*on;
return;
endif;
Sent: Wednesday, April 09, 2025 at 10:25 AM
From: dfreinkel@xxxxxxxxxxxxxxxxx
To: "'RPG programming on IBM i'" <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Calling Curl from RPG or CL
I am new to CURL.
I am looking for references on how to call CURL and maybe an example of
how
one calls curl from RPGLE or CLLE.
Thank you.
Darryl Freinkel
A4G
Telephone: 770.321.8562
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [2]
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [3]
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
References
Visible links
1.
https://deref-gmx.com/mail/client/nbgQxhA-F3U/dereferrer/?redirectUrl=https%3A%2F%2Fgithub.com%2Frichardschoen%2FQshOni
2.
https://lists.midrange.com/mailman/listinfo/rpg400-l
3.
https://archive.midrange.com/rpg400-l
As an Amazon Associate we earn from qualifying purchases.