Dear All,
I 've found this article from Fox Advisor ( Jul 2002 ) in TIps section.
When i tried i can't seem to be able to send data to HTTP the method open returns the contents of ASP page.
According to article i should be able to send data via Post to ASP page
Maybe someone can test it and tell me what is wrong.
I would appreciate response.
I made the ASP page with the name httpPostTest.asp
on which i have put form with textbox txtMyHtmlTextBox
Still when i execute the function from command mode i type
?senddata()
with no parameters i got the content of httpPostTest.ASP page
Here is the code ( using MSXML2.DLL) :
FUNCTION SendData (tcDataToSend, tcUrlTOPostTo)
LOCAL loXmlHttp, lcResponse
clea
IF PCOUNT()<2
* Use sample data
tcDataToSend = "txtMyHtmlTextBox=sampledata"
tcUrlTOPostTo = "ENDIF
loXmlHttp = CREATEOBJECT("MSXML2.XMLHTTP")
* Set the connection. The parameters are the data transfer
* method, the URL to connect to
* and if we are connectiong asynhroniously
loXmlHttp.open("POST",tcUrlTOPostTo,.f.)
* Set the post's request header.
loXmlHttp.setrequestHeader("content-type", ;
"application/x-* THis command submits the data to the web form.
loXmlHttp.send(tcDataToSend)
lcResponse = loXmlHttp.responsetext
loXmlHttp = .null.
*?lcResponse
RETURN lcResponse
Regards
Dejan
I 've found this article from Fox Advisor ( Jul 2002 ) in TIps section.
When i tried i can't seem to be able to send data to HTTP the method open returns the contents of ASP page.
According to article i should be able to send data via Post to ASP page
Maybe someone can test it and tell me what is wrong.
I would appreciate response.
I made the ASP page with the name httpPostTest.asp
on which i have put form with textbox txtMyHtmlTextBox
Still when i execute the function from command mode i type
?senddata()
with no parameters i got the content of httpPostTest.ASP page
Here is the code ( using MSXML2.DLL) :
FUNCTION SendData (tcDataToSend, tcUrlTOPostTo)
LOCAL loXmlHttp, lcResponse
clea
IF PCOUNT()<2
* Use sample data
tcDataToSend = "txtMyHtmlTextBox=sampledata"
tcUrlTOPostTo = "ENDIF
loXmlHttp = CREATEOBJECT("MSXML2.XMLHTTP")
* Set the connection. The parameters are the data transfer
* method, the URL to connect to
* and if we are connectiong asynhroniously
loXmlHttp.open("POST",tcUrlTOPostTo,.f.)
* Set the post's request header.
loXmlHttp.setrequestHeader("content-type", ;
"application/x-* THis command submits the data to the web form.
loXmlHttp.send(tcDataToSend)
lcResponse = loXmlHttp.responsetext
loXmlHttp = .null.
*?lcResponse
RETURN lcResponse
Regards
Dejan