Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP REQUEST ERROR HANDLING

JINESH GANDHI

IS-IT--Management
May 8, 2022
14
IN
HOW TO CHECK WHETHER THE SERVER REQUEST IS EXIST OR NOT.

loRequest = loHTTP.open('POST',"https://www.atariarprise.com/acdataup.php")
loHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
loHTTP.Send(lcformdata)

I would like to chec lohttp.open is exist or not? while using lotthp.send i found error OLE IDispatch exception code 0
 
It would help to post your full code, not just a snippet.

In the code you posted, there still are obvious errors. Assuming loHTTP is something like Msxml2.ServerXMLHTTP.6.0, then loHTTP.open does not return an object. The loHTTP object already is your request object.
When you call send it's readyState property will change and the reesponse from the server exists, when readyState is 4.
 
Thanks Chriss

Please find the code here with.

lcformdata=""
loHttp = CreateObject('Msxml2.ServerXMLHTTP.6.0')
v1=loHTTP.open('POST',"https://www.katariaenterprise.com/acdataup.php")
IF ISNULL(v1)
WAIT WINDOW "ax"
endif
loRequest = loHTTP.open('POST',"https://www.atariaenterprise.com/acdataup.php")
loHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
loHTTP.Send(lcformdata)
DO WHILE loHTTP.READYSTATE # 4
DOEVENTS
ENDDO

Before ready state statement the error stop the software, as per the screen shot given below i want to encounter error through code. please help me

1741263003508.png
 

Part and Inventory Search

Sponsor

Back
Top