Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP XML
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 4th, 2004, 05:32 AM
vvr vvr is offline
Registered User
 
Join Date: Dec 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with using POST method with XMLHTTP

How could I use POST method to transfer parameters with XMLHTTP?
With GET all works correct, but with POST I get a problem.

client.asp with GET - all works
<head>
<title> XMLHTTP Example </title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
dim objXMLHTTP
set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", "http://localhost/test/server.asp?fName=Mitchell", false
objXMLHTTP.Send
Response.Write(objXMLHTTP.responseText)
set objXMLHTTP = nothing
%>
</body>
</html>

client2.asp with POST - doesn't works
<head>
<title> XMLHTTP Example </title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
dim objXMLHTTP
set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "POST", "http://localhost/test/server.asp", false
objXMLHTTP.Send("fName=Mitchell")
Response.Write(objXMLHTTP.responseText)
set objXMLHTTP = nothing
%>
</body>
</html>

server.asp
<%
dim fName
if Request.ServerVariables("HTTP_METHOD") = "GET" then
    fName = Request.QueryString("fName")
elseif Request.ServerVariables("HTTP_METHOD") = "POST" then
    fName = Request.Form("fName")
end if
Response.Write "<Name_Details>"
Response.Write "<TheName>"
Select Case fName
    Case "Mitchell"
        Response.Write fName & " Harper"
    Case "John"
        Response.Write fName & " Doe"
    Case "Harry"
        Response.Write fName & " Potter"
    Case Else
        Response.Write "[Unknown]"
End Select
Response.Write "</TheName>"
Response.Write "</Name_Details>"
%>

Reply With Quote
  #2 (permalink)  
Old December 6th, 2004, 01:44 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following link:

http://www.4guysfromrolla.com/webtech/110100-1.shtml

Om Prakash
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
post xml using xmlhttp in vb.net datakix Classic ASP XML 4 August 7th, 2009 05:31 AM
Request Post XMLHttp : Need Help Kyum BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6 5 July 5th, 2007 09:51 PM
post xml using xmlhttp in vb.net datakix VB.NET 3 December 21st, 2004 01:31 PM
XML Post using microsoft.XMLHTTP csmajor231 XML 0 April 5th, 2004 03:06 PM
Using XMLHTTP to POST form data channer Classic ASP XML 8 January 6th, 2004 05:44 AM



All times are GMT -4. The time now is 05:16 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.