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:
00406465
Views:
45
If you use POST with XMLHTTP you have actually have to post something or the call will fail. I had this problem in my XML Chat - it would inconsistently fail when you post iwth no data. Using GET was caching so a POST fixed that problem, but I had to send a few bytes just in case.

You may also have to add the appropriate content type header to the request especially if you're posting to a non-IIS server or some backend software that checks for specific content types.

+++ Rick ---



>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()
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform