My question is, how can an ASP execute a POST to a specified URL in the same manner it can Redirect?
Why do I ask this (to help clarify if I'm not asking the question well enough)?
My client's product will POST to a paging provider's web site. It converts spaces in the URI to %20, but does not convert other special characters (double quotes). We've encountered a non-commercial, proprietary, in-house (read: annoying) paging provider that refuses messages that include double quotes.
I'm trying to write an ASP that will be a simple layer between our product and thier paging host. It will parse the string that would've been sent to thier host and convert double quotes to %22. But it must do a POST to their host.
I'm afraid that doing a Redirect with the URI as a query string with do a GET.
Hi,
I am not sure if you already tried the VBScript function UrlEncode, instead of parsing the string you could use URLEncode function that should convert all special charecters.
e.g.
VB Code:
<%
url="hello/? &^there" & chr(34)
url=server.urlencode(url)
response.write url
%>
would output
hello%2F%3F+%26%5Ethere%22
Also if you dont wanna use GET method then why not put the variable into a hidden form value and then post it.
URLEncode will replace characters that are supposed to be in the string. But that isn't the hard part.
I don't want to create a page with a form because I don't want to go back to the UA. I want one request to be forwarded and one page to be loaded by the requester. If I make a page with a form and submit that, then the requester makes a request, loads a page, and (if JavaScript is running) makes a second request to load a second page.
Now, I'm fine with the limitations (sending a response back to the original requester and just dumping the request from the paging provider into /dev/null). But I can't risk going back to the client twice.
It doesn't have to really. You can do the submit with a response.write. Javascript being disabled is still a risk although a small one- if it was, most everything on the web wouldn't work either.
I don't think there is a way within ASP/VBScript to do this without something going back to the client at some point. At least not as a HTTP post. You could probably write a COM object that posted the data for you. You would just have to create your own HTTP headers..
oOOo--oOOo
__/\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP [email protected] [email protected] Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
I believe the MSXML Components can do a HTTP POST.
Josh
Get these: MozillaOperaOpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
I think you are right there, Josh. Though I haven't gone down that route.
This is all resolved, and here is my funny story.
The head developer here at my client's site doesn't want to admit that the DLL he (poorly) wrote should not let certain characters be sent. So it was pushed on to me to make an in between ASP to clean up the work for the one proprietary paging provider who happens to be strict on the best practices.
Well, I figure that I can make the POST the same way this DLL does, by calling an INet object (wininet.dll or winhttp.dll or something like that). As I'm looking over the horrible code in the application DLL that actually makes the POST via the system DLL, I say to myself, "Self, if I put a single line of code right here the whole thing will be fixed."
So screw trying to make a work around, I'll actually fix the problem. But since this product belongs to my client and not me, I guess my fix won't be folded into the main build tree (they just now got version control).