Jump to content

Recommended Posts

Posted (edited)

Hi everyone,

I have a script that call this function again & again normaly

Func CallAPI($amount, $target, $condition, $API_key)
    $oHTTP.Open("POST","https://HOST?api_key="&$API_key)
    $oHTTP.SetRequestHeader('content-type','application/json')
    $oHTTP.Send('{"amount":'&$amount&',"target":'&$target&',"condition":"'&$condition&'"}')
    $Response = $oHTTP.ResponseText
    Return $Response
EndFunc

but sometime (may be after 105 request, 203 request, 1000 request, ... n request) this request error and make my script stop 

$oHTTP.Send('{"amount":'&$amount&',"target":'&$target&',"condition":"'&$condition&'"}')
$oHTTP.^ ERROR


I think sever response slow that make this request reached default timeout.

I try to set time out with hope if reached timeout this request will return error or something else and my script keep run continue

$oHTTP.SetTimeouts(30000,60000,30000,30000)
  Reveal hidden contents

but it when request reached timeout, my script error, exit and return the same message above.

Anyone have any idea too fix this disadvantage, or when sever response slow it will skip this request and return error code and countinue code without exit?

Thanks everyone T.T

Edited by nhocquan

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...