Ask a Question related to ASP, Design and Development.
-
Mike Lopez #1
Re: Programmatically create HTTP post
Thanks for the reply, Bob.
Unfortunately this won't work for me. The external web site is expecting an
HTTP POST document. My .asp server page processes the users' input, then
needs to construct an HTTP POST document that simulates an HTML page with a
<FORM> and four <INPUT> fields. My .asp page then needs to send this to the
external site and the process the results.
Here's what I would love to be able to do. HTTPDOMObject is a fictitious COM
object:
<%
dim sUserInput
dim oHTTPDocument <= fictitious object
dim oXMLHTTP
sUserInput = Request.Form("txtUserInput")
set oHTTPDocument = Server.CreateObject("HTTPDOMObject.Document")
oHTTPDocument.addTextField ("USERID", "MYUSERID")
oHTTPDocument.AddTextField("PWD", "MYPASSWORD")
oHTTPDocument.AddTextField("DETAILLEVEL", "FULL")
oHTTPDocument.AddTextField("SEARCHAGRUMENT", cstr(sUserInput))
oHTTPDocument.Method = "POST"
set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
....
oXMLHTTP.Send(oHTTPDocument.FormData)
I know how to employ the interfaces, I'm not quite sure how to construct the
HTTP POST document.
Does this clarify my problem, or perhaps I'm missing something.
Thanks again,
Mike
"Bob Barrows" <reb_01501@yahoo.com> wrote in message
news:u38BFwsSDHA.2460@TK2MSFTNGP10.phx.gbl...I've> This is more of a client-side coding question. However, here is a demo> created that illustrates how to use the XMLHTTPRequest object:
> [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp[/url]
> Scroll down to the Dynamic Listbox demo
>
> HTH,
> Bob Barrows
>
> Mike Lopez wrote:>> > Hello.
> >
> > From an .asp page, I need to "post" out to an external web site that
> > will return a result as an XML document.
> >
> > In particular, when a user posts to my .asp page, I need to simulate
> > a post of a page with four <input> fields, "call out" to the external
> > web site, and then process the returned XML.
> >
> > I was looking at the MSXML 4.0 parser's object model, and there are
> > send() methods of the IXMLHTTPRequest and
> > IServerXMLHTTPRequest/ServerXMLHTTP interfaces, but I'm not sure how
> > to "construct" the HTTP post data to send.
> >
> > Can anyone help?
> >
> > Thanks in advance,
> >
> > Mike
>
Mike Lopez Guest
-
[HOW TO DO] Programmatically create photograms?
LOT for you reply. Now I have the problem to refer to generated movieClip (how is it possible by name?) to move then and generate "trailer titles"... -
Programmatically create buttons from user control
Hello guys, I have an application which is built upon several user controls. That is, I have a default template (default.aspx) that I load a user... -
DBI/ODBC question: how to create DB programmatically?
Hi, I've been trying to figure out how to use ODBC with DBI. So far, I have created a DSN for an existing DB and managed to read tables, update... -
doing an http post
For the benefit of others, I want to show how to do an HTTP POST request using fsockopen(). I banged my head against a wall for two days trying to... -
create treeview control programmatically
see http://support.microsoft.com/default.aspx?scid=KB;EN-US;210125 "William Grigg" <wgrigg@draper.com> wrote in message... -
Mark Schupp #2
Re: Programmatically create HTTP post
[url]www.aspfaq.com[/url]
look for "Post" or "simulating a post request"
--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
[email]mschupp@ielearning.com[/email]
[url]http://www.ielearning.com[/url]
714.637.9480 x17
"Mike Lopez" <mikelpez@optonline.net> wrote in message
news:eLYUvEtSDHA.1916@TK2MSFTNGP12.phx.gbl...an> Thanks for the reply, Bob.
>
> Unfortunately this won't work for me. The external web site is expectinga> HTTP POST document. My .asp server page processes the users' input, then
> needs to construct an HTTP POST document that simulates an HTML page withthe> <FORM> and four <INPUT> fields. My .asp page then needs to send this toCOM> external site and the process the results.
>
> Here's what I would love to be able to do. HTTPDOMObject is a fictitiousthe> object:
>
> <%
>
> dim sUserInput
> dim oHTTPDocument <= fictitious object
> dim oXMLHTTP
> sUserInput = Request.Form("txtUserInput")
>
> set oHTTPDocument = Server.CreateObject("HTTPDOMObject.Document")
> oHTTPDocument.addTextField ("USERID", "MYUSERID")
> oHTTPDocument.AddTextField("PWD", "MYPASSWORD")
> oHTTPDocument.AddTextField("DETAILLEVEL", "FULL")
> oHTTPDocument.AddTextField("SEARCHAGRUMENT", cstr(sUserInput))
> oHTTPDocument.Method = "POST"
> set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
> ...
> oXMLHTTP.Send(oHTTPDocument.FormData)
>
>
> I know how to employ the interfaces, I'm not quite sure how to construct> HTTP POST document.
>
> Does this clarify my problem, or perhaps I'm missing something.
>
> Thanks again,
>
> Mike
>
> "Bob Barrows" <reb_01501@yahoo.com> wrote in message
> news:u38BFwsSDHA.2460@TK2MSFTNGP10.phx.gbl...> I've> > This is more of a client-side coding question. However, here is a demo>> > created that illustrates how to use the XMLHTTPRequest object:
> > [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp[/url]
> > Scroll down to the Dynamic Listbox demo
> >
> > HTH,
> > Bob Barrows
> >
> > Mike Lopez wrote:> >> > > Hello.
> > >
> > > From an .asp page, I need to "post" out to an external web site that
> > > will return a result as an XML document.
> > >
> > > In particular, when a user posts to my .asp page, I need to simulate
> > > a post of a page with four <input> fields, "call out" to the external
> > > web site, and then process the returned XML.
> > >
> > > I was looking at the MSXML 4.0 parser's object model, and there are
> > > send() methods of the IXMLHTTPRequest and
> > > IServerXMLHTTPRequest/ServerXMLHTTP interfaces, but I'm not sure how
> > > to "construct" the HTTP post data to send.
> > >
> > > Can anyone help?
> > >
> > > Thanks in advance,
> > >
> > > Mike
> >
>
Mark Schupp Guest
-
Paul Baker #3
Re: Programmatically create HTTP post
Look in this article: for the code that includes the all-important:
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
"Mark Schupp" <mschupp@ielearning.com> wrote in message
news:%23t5FkeuSDHA.1552@TK2MSFTNGP12.phx.gbl...with> [url]www.aspfaq.com[/url]
>
> look for "Post" or "simulating a post request"
>
> --
> Mark Schupp
> --
> Head of Development
> Integrity eLearning
> Online Learning Solutions Provider
> [email]mschupp@ielearning.com[/email]
> [url]http://www.ielearning.com[/url]
> 714.637.9480 x17
>
>
> "Mike Lopez" <mikelpez@optonline.net> wrote in message
> news:eLYUvEtSDHA.1916@TK2MSFTNGP12.phx.gbl...> an> > Thanks for the reply, Bob.
> >
> > Unfortunately this won't work for me. The external web site is expecting> > HTTP POST document. My .asp server page processes the users' input, then
> > needs to construct an HTTP POST document that simulates an HTML pageexternal> a> the> > <FORM> and four <INPUT> fields. My .asp page then needs to send this to> COM> > external site and the process the results.
> >
> > Here's what I would love to be able to do. HTTPDOMObject is a fictitious> the> > object:
> >
> > <%
> >
> > dim sUserInput
> > dim oHTTPDocument <= fictitious object
> > dim oXMLHTTP
> > sUserInput = Request.Form("txtUserInput")
> >
> > set oHTTPDocument = Server.CreateObject("HTTPDOMObject.Document")
> > oHTTPDocument.addTextField ("USERID", "MYUSERID")
> > oHTTPDocument.AddTextField("PWD", "MYPASSWORD")
> > oHTTPDocument.AddTextField("DETAILLEVEL", "FULL")
> > oHTTPDocument.AddTextField("SEARCHAGRUMENT", cstr(sUserInput))
> > oHTTPDocument.Method = "POST"
> > set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
> > ...
> > oXMLHTTP.Send(oHTTPDocument.FormData)
> >
> >
> > I know how to employ the interfaces, I'm not quite sure how to construct> > HTTP POST document.
> >
> > Does this clarify my problem, or perhaps I'm missing something.
> >
> > Thanks again,
> >
> > Mike
> >
> > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
> > news:u38BFwsSDHA.2460@TK2MSFTNGP10.phx.gbl...> > I've> > > This is more of a client-side coding question. However, here is a demo> > > created that illustrates how to use the XMLHTTPRequest object:
> > > [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp[/url]
> > > Scroll down to the Dynamic Listbox demo
> > >
> > > HTH,
> > > Bob Barrows
> > >
> > > Mike Lopez wrote:
> > > > Hello.
> > > >
> > > > From an .asp page, I need to "post" out to an external web site that
> > > > will return a result as an XML document.
> > > >
> > > > In particular, when a user posts to my .asp page, I need to simulate
> > > > a post of a page with four <input> fields, "call out" to the>> >> > > > web site, and then process the returned XML.
> > > >
> > > > I was looking at the MSXML 4.0 parser's object model, and there are
> > > > send() methods of the IXMLHTTPRequest and
> > > > IServerXMLHTTPRequest/ServerXMLHTTP interfaces, but I'm not sure how
> > > > to "construct" the HTTP post data to send.
> > > >
> > > > Can anyone help?
> > > >
> > > > Thanks in advance,
> > > >
> > > > Mike
> > >
> > >
> >
>
Paul Baker Guest
-
Paul Baker #4
Re: Programmatically create HTTP post
Look in this article:
[url]http://www.aspfaq.com/show.asp?id=2173[/url]
Look for the code that includes this line:
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Paul
"Mark Schupp" <mschupp@ielearning.com> wrote in message
news:%23t5FkeuSDHA.1552@TK2MSFTNGP12.phx.gbl...with> [url]www.aspfaq.com[/url]
>
> look for "Post" or "simulating a post request"
>
> --
> Mark Schupp
> --
> Head of Development
> Integrity eLearning
> Online Learning Solutions Provider
> [email]mschupp@ielearning.com[/email]
> [url]http://www.ielearning.com[/url]
> 714.637.9480 x17
>
>
> "Mike Lopez" <mikelpez@optonline.net> wrote in message
> news:eLYUvEtSDHA.1916@TK2MSFTNGP12.phx.gbl...> an> > Thanks for the reply, Bob.
> >
> > Unfortunately this won't work for me. The external web site is expecting> > HTTP POST document. My .asp server page processes the users' input, then
> > needs to construct an HTTP POST document that simulates an HTML pageexternal> a> the> > <FORM> and four <INPUT> fields. My .asp page then needs to send this to> COM> > external site and the process the results.
> >
> > Here's what I would love to be able to do. HTTPDOMObject is a fictitious> the> > object:
> >
> > <%
> >
> > dim sUserInput
> > dim oHTTPDocument <= fictitious object
> > dim oXMLHTTP
> > sUserInput = Request.Form("txtUserInput")
> >
> > set oHTTPDocument = Server.CreateObject("HTTPDOMObject.Document")
> > oHTTPDocument.addTextField ("USERID", "MYUSERID")
> > oHTTPDocument.AddTextField("PWD", "MYPASSWORD")
> > oHTTPDocument.AddTextField("DETAILLEVEL", "FULL")
> > oHTTPDocument.AddTextField("SEARCHAGRUMENT", cstr(sUserInput))
> > oHTTPDocument.Method = "POST"
> > set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
> > ...
> > oXMLHTTP.Send(oHTTPDocument.FormData)
> >
> >
> > I know how to employ the interfaces, I'm not quite sure how to construct> > HTTP POST document.
> >
> > Does this clarify my problem, or perhaps I'm missing something.
> >
> > Thanks again,
> >
> > Mike
> >
> > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
> > news:u38BFwsSDHA.2460@TK2MSFTNGP10.phx.gbl...> > I've> > > This is more of a client-side coding question. However, here is a demo> > > created that illustrates how to use the XMLHTTPRequest object:
> > > [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp[/url]
> > > Scroll down to the Dynamic Listbox demo
> > >
> > > HTH,
> > > Bob Barrows
> > >
> > > Mike Lopez wrote:
> > > > Hello.
> > > >
> > > > From an .asp page, I need to "post" out to an external web site that
> > > > will return a result as an XML document.
> > > >
> > > > In particular, when a user posts to my .asp page, I need to simulate
> > > > a post of a page with four <input> fields, "call out" to the>> >> > > > web site, and then process the returned XML.
> > > >
> > > > I was looking at the MSXML 4.0 parser's object model, and there are
> > > > send() methods of the IXMLHTTPRequest and
> > > > IServerXMLHTTPRequest/ServerXMLHTTP interfaces, but I'm not sure how
> > > > to "construct" the HTTP post data to send.
> > > >
> > > > Can anyone help?
> > > >
> > > > Thanks in advance,
> > > >
> > > > Mike
> > >
> > >
> >
>
Paul Baker Guest
-
Mike Lopez #5
Re: Programmatically create HTTP post
You're the man, Mark. That's all I had to do.
Thanks a million.
Mike
"Paul Baker" <ask> wrote in message
news:%23I%23CyiuSDHA.1664@TK2MSFTNGP11.phx.gbl..."application/x-www-form-urlencoded"> Look in this article: for the code that includes the all-important:
> xmlhttp.setRequestHeader "Content-Type",expecting>
>
> "Mark Schupp" <mschupp@ielearning.com> wrote in message
> news:%23t5FkeuSDHA.1552@TK2MSFTNGP12.phx.gbl...> > [url]www.aspfaq.com[/url]
> >
> > look for "Post" or "simulating a post request"
> >
> > --
> > Mark Schupp
> > --
> > Head of Development
> > Integrity eLearning
> > Online Learning Solutions Provider
> > [email]mschupp@ielearning.com[/email]
> > [url]http://www.ielearning.com[/url]
> > 714.637.9480 x17
> >
> >
> > "Mike Lopez" <mikelpez@optonline.net> wrote in message
> > news:eLYUvEtSDHA.1916@TK2MSFTNGP12.phx.gbl...> > > Thanks for the reply, Bob.
> > >
> > > Unfortunately this won't work for me. The external web site isthen> > an> > > HTTP POST document. My .asp server page processes the users' input,to> with> > > needs to construct an HTTP POST document that simulates an HTML page> > a> > > <FORM> and four <INPUT> fields. My .asp page then needs to send thisfictitious> > the> > > external site and the process the results.
> > >
> > > Here's what I would love to be able to do. HTTPDOMObject is aconstruct> > COM> > > object:
> > >
> > > <%
> > >
> > > dim sUserInput
> > > dim oHTTPDocument <= fictitious object
> > > dim oXMLHTTP
> > > sUserInput = Request.Form("txtUserInput")
> > >
> > > set oHTTPDocument = Server.CreateObject("HTTPDOMObject.Document")
> > > oHTTPDocument.addTextField ("USERID", "MYUSERID")
> > > oHTTPDocument.AddTextField("PWD", "MYPASSWORD")
> > > oHTTPDocument.AddTextField("DETAILLEVEL", "FULL")
> > > oHTTPDocument.AddTextField("SEARCHAGRUMENT", cstr(sUserInput))
> > > oHTTPDocument.Method = "POST"
> > > set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
> > > ...
> > > oXMLHTTP.Send(oHTTPDocument.FormData)
> > >
> > >
> > > I know how to employ the interfaces, I'm not quite sure how todemo> > the> > > HTTP POST document.
> > >
> > > Does this clarify my problem, or perhaps I'm missing something.
> > >
> > > Thanks again,
> > >
> > > Mike
> > >
> > > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
> > > news:u38BFwsSDHA.2460@TK2MSFTNGP10.phx.gbl...
> > > > This is more of a client-side coding question. However, here is athat> > > I've
> > > > created that illustrates how to use the XMLHTTPRequest object:
> > > > [url]http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp[/url]
> > > > Scroll down to the Dynamic Listbox demo
> > > >
> > > > HTH,
> > > > Bob Barrows
> > > >
> > > > Mike Lopez wrote:
> > > > > Hello.
> > > > >
> > > > > From an .asp page, I need to "post" out to an external web sitesimulate> > > > > will return a result as an XML document.
> > > > >
> > > > > In particular, when a user posts to my .asp page, I need toare> external> > > > > a post of a page with four <input> fields, "call out" to the> > > > > web site, and then process the returned XML.
> > > > >
> > > > > I was looking at the MSXML 4.0 parser's object model, and therehow> > > > > send() methods of the IXMLHTTPRequest and
> > > > > IServerXMLHTTPRequest/ServerXMLHTTP interfaces, but I'm not sure>> >> > > > > to "construct" the HTTP post data to send.
> > > > >
> > > > > Can anyone help?
> > > > >
> > > > > Thanks in advance,
> > > > >
> > > > > Mike
> > > >
> > > >
> > >
> > >
> >
>
Mike Lopez Guest



Reply With Quote

