Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capturing data on client machine from a ASP page.
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00384415
Message ID:
00405900
Views:
46
Mike,

Using XMLHTTP Control to duplicate an HTML Form Submit.

I created an HTML page with this form:

FORM ACTION="http://www.usps.gov/cgi-bin/zip4/zip4inq" METHOD=POST
INPUT TYPE=hidden NAME=street VALUE="1030 Honey Hill Dr."
INPUT TYPE=hidden NAME=zip VALUE="77077"
INPUT TYPE=submit VALUE="Standardized US Address"
/FORM

The Form sends this address to the Post Office and the Post Office server will send back the corrected address (if there are errors) plus Zip+4, Carrier Route, Delivery Point Number, etc.

I want to duplicate this Form using the XMLHTTP Control but I'm not sure how to duplicate what the HTML Form is actually sending to the Postal Server. What I have so far using your previous example as a template is:

oX=CreateObject('microsoft.xmlhttp')
oX.Open("GET", "http://www.usps.gov/cgi-bin/zip4/zip4inq?Submit=Standardized+US+Address&street=1030+Honey+Hill&zip=77077", .f.)
oX.Send()
? oX.ResponseText

What happens is that I get a message back from the Postal Server that says "This Script should be referenced with a METHOD of POST."

Figuring that the OPEN("GET"…. might have been a METHOD=GET, I changed this line to OPEN("POST",…. but got the same results.

Any idea of what I should be sending as my oX.OPEN()?

Any Help would be appreciated.

Ed


>Microsoft's XMLHTTP control (contained in their xml parser in msxml.dll)
>
>Try this in the vfp command window:
>oX=CreateObject('microsoft.xmlhttp')
>oX.Open("GET", "http://www.microsoft.com", .f.)
>oX.Send()
>?oX.ResponseText
>?oX.GetAllResponseHeaders()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform