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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 code to VFP 1

Status
Not open for further replies.

JRB-Bldr

Programmer
May 17, 2001
3,281
US
OK -- all you cross-disciplinary developers, I could use some assistance with the following.

I have a vendor who refuses to provide ANY but the absolute most minimal help in resolving problems with my sending an HTTP Post to them.

Their only reply is "In VB6, this is all I have to do using the XML object." Not totally helpful!!!

Well here is the VB6 code that they provided:
Code:
Private Function PostXML(xml As String) As String

Dim XslHttp As MSXML2.XMLHTTP

    Set XslHttp = New MSXML2.XMLHTTP
    XslHttp.open "POST", "[URL unfurl="true"]https://typhoonmanager.com/XMLPost/post.asp?ID=a012345",[/URL] False, "", ""
    XslHttp.setRequestHeader "content-type", "text/xml"
    XslHttp.send (xml)

    PostXML = XslHttp.responseText

    Set XslHttp = Nothing
    
End Function

Since I am using the Chilkat HTTP ActiveX modules, I will see if they can assist me in converting the above into VFP code using their own HTTP ActiveX modules.

But, in the mean time, if someone can help me twist that code into VFP code, it would be greatly appreciated.

Thanks,
JRB-Bldr
 
Well, I'm definitely not a VB type, but I've been in the same position regarding VB-only support people, so I'll give it a try:

Code:
FUNCTION PostXML
LPARAMETERS xml
LOCAL XslHttp 
XslHttp = CREATEOBJECT("MSXML2.XMLHTTP")
XslHttp.open("POST", ;
  "[URL unfurl="true"]https://typhoonmanager.com/XMLPost)/post.asp?ID=a012345",;[/URL]
  .F., "", "")
XslHttp.setRequestHeader("content-type", "text/xml")
XslHttp.send(xml)
RETURN XslHttp.responseText    
ENDFUNC

No warranties given or implied. If someone tells you the above is wrong, they're probably right.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike.
I'll try it out and see what happens.

Thanks,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top