[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Timeout parm and log file for HTPAPI



Hello Farhan,


Q: What if we need to change to 1sec to have no delay on a batch job which seems to be taking much time integrating the orders from external source using HTTPAPI. Would that do any damage or exceptions?

A: If you change the timeout to 1 second, and there is a lag in the network where you do not connect or receive data for 1 second, HTTPAPI will set the RC of http_url_post to 0.   Whether that does "damage" or raises exceptions will depend on how your program treats that rc=0 response. 

If the network/server can return the document without a 1 second delay in receipt, then it will make no difference at all. 

It also will not make a large document receive quicker.  For example, if it takes you 2 minutes to download a 20 megabyte file, it'll still take 2 minutes even if you give it a 1 second timeout.  It will not stop after 1 second unless there is lag preventing it from receiving anything.


Q: Where and how do we get the logs on HTTPAPI to see all info. Is it somewhere in an IFS folder or needs to be turned on somehow before getting any logs for it.

You can call the http_debug() procedure to tell HTTPAPI to produce a full trace.  For example:

http_debug(*ON: '/tmp/my_lovely_file.txt');

Where the log is placed depends on what you pass for the 2nd parameter.  If you do not provide the second parameter, it will use a default name of /tmp/httpapi_debug.txt in your IFS.

-- 
Scott Klement
sk@xxxxxxxxxxxxxxxx

On 2/25/2021 6:29 AM, Farhan Qadri wrote:

Hi,

 

A bit new to HTTPAPI and trying to maintain a code inherited.

 

I have a program which sends a data out to a URL to get the answer back as XML as follows:

 

EVAL      rc=http_url_post(%trim(pRqUrl1)

               : p_data: st_size:       

                %trim(pAnswer):30)      

 

Last December , I put the :30 at the end of the statement just to bring the timeout value from default 60 to 30 second. As per my understanding, this timeout only work if the response on the post takes some time for a response back and hence could wait till 30 seconds now. What if we need to change to 1sec to have no delay on a batch job which seems to be taking much time integrating the orders from external source using HTTPAPI. Would that do any damage or exceptions?

 

Second question is regarding logs for the HTTPAPI. Where and how do we get the logs on HTTPAPI to see all info. Is it somewhere in an IFS folder or needs to be turned on somehow before getting any logs for it.

 

Some urgent insight would be appreciated.

 

Thanks

Farhan



The information transmitted is intended only for the person or entity to which it is addressed and may contain proprietary, business-confidential and/or privileged material. If you are not the intended recipient of this message you are hereby notified that any use, review, retransmission, dissemination, distribution, reproduction or any action taken in reliance upon this message is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi