• Subject: Re: Calling Curl from RPG or CL
  • From: Michael Fulmer <mfulmer@xxxxxxx>
  • Date: Wed, 9 Apr 2025 16:51:15 +0200
  • List-archive: <https://archive.midrange.com/rpg400-l/>
  • List-post: <mailto:rpg400-l@lists.midrange.com>
  • List-subscribe: <https://lists.midrange.com/mailman/listinfo/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=subscribe>
  • List-unsubscribe: <https://lists.midrange.com/mailman/options/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=unsubscribe>
  • Ui-outboundreport: notjunk:1;M01:P0:z8SqnK5m91A=;2Eh54xnqILUhotIgwHBnnSsfHMU bEOsxv3LU90VEItHbbr6wROD1H2TTYCBe0u0al9KM0a/C2uVOakMLLh76W42Xctk21TXL9B3E 7W2NY1f+o6T5hli6R+jTC96vvJZdR7AF/RJszP1sSJxQ7BJbX9IgeCW9ZCAGmkGc+grAGm40q kqRk5WsqvPRQsfk3HB82MbLi5QomnjesloFMCN3ItymyQ1WUZXdeMa1mQRGVSDD9Z8Jz1lHUH Uxl/6bzo1OAucdWmQWMf4CCD/4LccpqXwqFAsmTZhDjRmYzFR+d3fKNW1wOD7kn0jRssCtDRN Bf0d9kagEgAX9C4iWuVr1lTODhW8DhrEZfieVAWJR+LCrfngPLrWuWcLb/DIbDkDcw7IDAzQr FCHMW/USAF3PH/uQeTEHwm9mQzZ9B/wF+v9cw1LuolWGGo+8g56wHXqc29ATv7h8y4YgJ2LeH xx/5ldvTipamOPDgJ5holfeUAdgSofumucG4wQNcsx1l8YBDntPmIINoSuxj5KwzR9TA55pxY NM2+tMuKrwR+gHdzPPLXONh0Yi+qftIIeOS6uNq7oT5JGScYADaCh8C2dMmwiallpQDYldufz VE/nErZrgQFt8LE7kkpob8UTBbCmOLj3VBLSbOz7tg0rX7RdfTxnZCWFRzjLIOJpuWunrzV/f OzIzaQ3zn94Tx69YyVCxmmhfmN0OcPfcAZsLbOpsOuPvex7osr+Rk9gfwX4+n0eXvFOcPznZj IQ9QO89PJ/ggcbAguWVlEwG+d1oYLPLwIoaoKdoOaZpwss9TdGuKCKsCM4ZYjKMlQdQ72LArw A+RZb3YEPZPiKxvLjZPGy4VdhCZjgW3mBgdLulPCWI9SHi3p3gutgB3yUO1dJaQh/i87jdge4 08rSiUqzHB0+8WAkCotRJdYkbrHC5QbUXTDlfdiSrBwddc6dv44JGWKoPS8q5JjZwDkvlzPKi +uMInEwANQRmfpDK1HdZqXE/sp5x2CzGm/jw8yvCm2Mq96ANV2YXaf9Zxl7fRpZyOm5hNdBxq xcZuNImsbwINtcPs8+E+xFH+jvuu1XEz2GNbs6qCbYX5Of8ubkuvQvsOy/vUDQbyIA0LXCFsF OLHk5rWvNxBpCsWyRLMWWqPEl9kOtn4w22raGpyyMdQBIO6HJ3sES/V93+2CgNQezWqbrDJWV 25WitZO0255+wxbTgytFicFQIDAGLEwkF4Uugkh2SIJX28pYWM9Yf3QDN7vyxvLX7tB6Y8las Kd0OdHTPk+Sgz5NImpIMicL0TPU+BexK4USH2KiaOiEo3PZxVgERDeackGsX7bBZPKOeDFdbb zjX

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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 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.