travisbrown
Technical User
- Dec 31, 2001
- 1,016
I'm trying to post to a newsletter database (Vertical Response).
When I use the HTML form, it works fine.
When I use the XMLHTTP post it bombs, returns "System does not support the specified encoding". I've never seen this before.
Another tertiary issue - is there a way to append a querystring to an XMLHTTP POST (rather than get)? Looks like the destination server needs a QS string as well as using the posted data.
Any ideas?
When I use the HTML form, it works fine.
When I use the XMLHTTP post it bombs, returns "System does not support the specified encoding". I've never seen this before.
Another tertiary issue - is there a way to append a querystring to an XMLHTTP POST (rather than get)? Looks like the destination server needs a QS string as well as using the posted data.
Any ideas?
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<form method="post" action="[URL unfurl="true"]http://oi.vresp.com?fid=6993457771"[/URL] >
<label style="color: #333333;">Email Address:</label><br/>
<input name="email_address" size="15" value="<% = CDBL(DATE()) & "@test.com" %>" /> <input type="submit" value="Join Now" /><br/>
</form>
<%
url = "[URL unfurl="true"]http://oi.vresp.com"[/URL]
response.write XMLHTTPPOST(url,"fid=6993457771&email_address=" & CDBL(DATE()) & "@test.com")
FUNCTION XMLHTTPPOST(url,params)
url = url '& "?fid=6993457771"
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
xml.Open "POST", url, False
xml.setRequestHeader "Content-Type", "application/x-[URL unfurl="true"]www-form-urlencoded"[/URL]
xml.Send params
Response.ContentType = "text/html"
XMLHTTPPOST = xml.responseText
Set xml = Nothing
END FUNCTION
%>
</body>
</html>