Timeout Using http_stmf

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
emhill
Posts: 43
Joined: Thu Jul 29, 2021 1:15 pm

Timeout Using http_stmf

Post by emhill »

I am using the following to connect and post to a remote site. It then sends data back in JSON format:

Code: Select all

http_stmf( 'POST'              
         : claimurl            
         : resultpath          
         : jsonpath            
         : 'application/json');


I am getting a timeout error in the httpapi_debug.txt. If I run this using PostMan it works but takes about two minutes to connect and retrieve the data. Is there a default timeout on the http_stmf? This has been working for a while now but today decides to stop with the timeout errors.

I'm going to get with the receiving site to see if anything is amiss there as well.

Thanks!!!
Scott Klement
Site Admin
Posts: 652
Joined: Sun Jul 04, 2021 5:12 am

Re: Timeout Using http_stmf

Post by Scott Klement »

HTTPAPI ships with a default timeout of 60 seconds.

You can override it like this:

Code: Select all

http_setOption('timeout': '300');   // timeout = 5 minutes
emhill
Posts: 43
Joined: Thu Jul 29, 2021 1:15 pm

Re: Timeout Using http_stmf

Post by emhill »

Perfect!!!! Thanks Scott....
Post Reply