Link to home
Start Free TrialLog in
Avatar of Theo Kouwenhoven
Theo KouwenhovenFlag for Netherlands

asked on

LIBHTTP Post result

Hi experts,

I use LIBHTTP to call a restservice (POST)
On this moment I use :
http_post(URL                         
         : %addr(myJSON:*data )       
         : %len(%trim(myJSON))        
         : '/home/user/result.dta' 
         : HTTP_TIMEOUT               
         : HTTP_USERAGENT             
         : 'application/json' );  

Open in new window

The result is written to a resultfile, I prefer to get the result in a variable in the program,
what do I have to change to accomplish that?
Avatar of David Favor
David Favor
Flag of United States of America image

I tried reading through the http_post IBM docs.

As usual, IBM docs seem to leave out 99% of what's required to get their code to work.

Looks like you must register a function as a callback to use data, rather than output to a file.

Seems like a massive amount of overkill. You may be better off just making a callout to a command line tool, like curl, so your POST processing is synchronous/inlined rather than callback based.

Or you can always attempt to understand IBM's docs about how to build your callback to do asynchronous processing of your data.

Tip: Because IBM docs are so... barely understandable... Best you actually post a link to docs for http_post() you're using, as it's unclear I was even reading the correct docs.
Avatar of Theo Kouwenhoven

ASKER

Hi David,

Oke that is what I fond until now, I hoped there were some features I didn't discover.

Curl on iSeries?
is that a Qshell program?
standard or do I have to install that?
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
CURL seems to be a nice option, but not flexible enough.
I need the possibility  to send a (large) IFS file and not in a 72K commandline.