[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: POST to an asp



Sender: michaelr_41@xxxxxxxxxxxxxx

Hi Scott -

I will try that directly and let you know the results.

Thanks!


On Wed, 12 May 2004 12:28:59 -0500 (CDT), "Scott Klement"
<sk@xxxxxxxxxxxxxxxx> said:
> Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
> 
> 
> Hi Michael,
> 
> There are two ways of submitting web form data to a web server, they are
> called the "POST" method and the "GET" method.
> 
> In the POST method, you tell the web server the URL, and then you send a
> mass of data to the server in a "document upload" manner.
> 
> In the GET method, you tell the web server the URL, and encoded into that
> URL is all of the data that you want to send -- so no additional upload
> is
> required.
> 
> The GET method is the original method used for submitting forms to web
> pages.  The only reason that it exists is that in the original HTTP spec,
> there was no provision for uploading, only downloading.  So, the
> workaround was to encode everything into the URL that's send with the
> request.
> 
> After the POST method was added, the GET method fell into disfavor.
> 
> What your vendor appears to be doing is using a JavaScript (Which is MUCH
> MUCH newer than the POST directive) to append the form data to the URL,
> in
> a strange "hack" to make POST work just like GET -- with all of GET's
> inherant limitations.   And they're also encoding the data improperly,
> and
> relying on the web browser to fix it for them.   Very poor design.  Very
> poor implementation.
> 
> At any rate, if your goal is to mimic that bad behavior (which I guess
> you
> have to unless the vendor is willing to fix his ASP to use POST properly)
> you can do with the http_url_get() or http_url_get_raw() functions.
> 
> In your code, replace the http_url_post_raw with something like this:
> 
>  rc = http_url_get_raw('http://www.twcs.com/artvan/' +
>                            'sample3.asp'+Data:
>                            10: %paddr('INCOMING'));
> 
> HTTPAPI currently has a limit of 256 bytes in the URL, so that might end
> up causing a problem for you.
> 
> Also, you'll have to URL encode your data in the URL, which means that
> spaces need to be changed to plus symbols, and other special characters
> need to be encoded as %xx where xx is the hex value of the character.
> 
> I'm working on adding a routine to HTTPAPI to do that, but I haven't
> finished it yet.
> 
> 
> ---
> Scott Klement  http://www.scottklement.com
> 
> On Wed, 12 May 2004 michaelr_41@xxxxxxxxxxxxxx wrote:
> >
> > Well, I think I've narrowed down my problem. It looks like I need to send
> > a url like this:
> >
> > http://www.xxxx.com/xxxxxx/sample3.asp?appreq=avf
> >
> > When I use the http_url_post_raw function like this:
> >
> > rc = http_url_post_raw('http://www.xxxx.com/xxxxxx/sample3.asp'
> >                        : %addr(Data)
> >                        : %len(%trimr(Data))
> >                        : 1
> >                        : %paddr('INCOMING'));
> >
> > It (the receiving IIS site) seems to break up the incoming data stream
> > into two HTTP requests: the URL and the information in the variable Data.
> > It's trying to parse the stuff in Data out as the host name, service,
> > path name, etc. which is obviously not going to work well.
> >
> > So, I'm now trying to pass everything in a variable like this:
> >
> > D URLData         s          32768    Inz('?appreq=')
> > D NewData         s              1    Inz('V')
> >
> > URLData = 'http://www.xxxx.com/xxxxxx/sample3.asp' +
> >           %Trim(URLData) + 'avf' + CRLF;
> >
> > rc = http_url_post_raw(URLData
> >                        : %addr(NewData)
> >                        : %len(%trimr(NewData))
> >                        : 1
> >                        : %paddr('INCOMING'));
> >
> > But this doesn't seem to work either.
> >
> > So, my current question is: Is there a POST function that just posts
> > what's in the URL and doesn't use the second and third paramters?
> >
> > Thanks...
> >
> > - Michael
> >
> > On Wed, 12 May 2004 09:53:38 -0400, michaelr_41@xxxxxxxxxxxxxx said:
> > > Sender: michaelr_41@xxxxxxxxxxxxxx
> > >
> > > Thanks Tom...I don't control the IIS web site, but I'm sure I can talk
> > > them into looking at it. I'm also going to look at a potential proxy
> > > issue on my side. I'll keep you posted.
> > >
> > > - Michael
> > >
> > > On Wed, 12 May 2004 09:23:34 -0400, "Tom Carriere" <carriere@xxxxxxx>
> > > said:
> > > > Sender: "Tom Carriere" <carriere@xxxxxxx>
> > > >
> > > > If I recall, you are trying to post and receive data to and from an IIS
> > > > Web
> > > > site.
> > > > I would try the following.
> > > >
> > > > 1.  Turn extended logging on the IIS WEB site and review the log to see
> > > > if
> > > >     it contains your post command with all of your parameters.  This
> > > > confirms that
> > > >     the server received your data.  If you do not control the WEB site,
> > > >     then
> > > >     ask the owner of the site to review the log file.
> > > >
> > > > 2.  If your IIS Web site is running a .Net service then, the HTTP POST
> > > > and
> > > > HTTP GET may
> > > >     be disabled in the web config file.
> > > >
> > > > -----Original Message-----
> > > > From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx]On
> > > > Behalf Of michaelr_41@xxxxxxxxxxxxxx
> > > > Sent: Tuesday, May 11, 2004 4:49 PM
> > > > To: ftpapi@xxxxxxxxxxxxx
> > > > Subject: RE: POST to an asp
> > > >
> > > >
> > > > Sender: michaelr_41@xxxxxxxxxxxxxx
> > > >
> > > > I'll give the packet sniffer a try.
> > > >
> > > > - Michael
> > > >
> > > > On Tue, 11 May 2004 15:20:05 -0500 (CDT), "Scott Klement"
> > > > <sk@xxxxxxxxxxxxxxxx> said:
> > > > > Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
> > > > >
> > > > >
> > > > > > I took Tom's advice and closed the socket, but I'm still not getting
> > > > data
> > > > > > returned. I've tried http_url_post and http_url_post_raw. I also tried
> > > > > > omitting the last three parameters on http_url_post_raw to see if that
> > > > > > would do anything, but no joy.
> > > > >
> > > > > That's what I expected, based on your symptoms your problem wasn't the
> > > > > same as Tom's...  the only reason I asked if it helped was because you
> > > > > said something to the effect of "Very cool, Tom, Thanks!" and I wasn't
> > > > > sure if that meant that the problem was solved.
> > > > >
> > > > >
> > > > > > I'm making the connection and I assume I'm sending the data. I don't see
> > > > > > any obvious errors in the debug file. The connection is broken and no
> > > > > > data is returned. Access the same site from a browser (IE 6.0) processes
> > > > > > as expected.
> > > > > >
> > > > > > Let me know if there's anything you would like me to try.
> > > > >
> > > > > I intend to take a look at this myself and see if I can figure it out --
> > > > > but it'll have to wait until I'm done with my "for pay" work.
> > > > >
> > > > > If you want to try to solve the problem your self (which would be a lot
> > > > > nicer for me.. heh) I'd suggest running a packet sniffer so that you can
> > > > > see the difference between what IE is sending to the server and what
> > > > > HTTPAPI is sending to the server.
> > > > >
> > > > > Personally, I like to use Ethereal for this:  http://www.ethereal.com
> > > > > -----------------------------------------------------------------------
> > > > > This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> > > > > to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> > > > > -----------------------------------------------------------------------
> > > > --
> > > >
> > > >   michaelr_41@xxxxxxxxxxxxxx
> > > >
> > > > --
> > > > http://www.fastmail.fm - Consolidate POP email and Hotmail in one place
> > > > -----------------------------------------------------------------------
> > > > This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> > > > to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> > > > -----------------------------------------------------------------------
> > > >
> > > > -----------------------------------------------------------------------
> > > > This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> > > > to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> > > > -----------------------------------------------------------------------
> > > --
> > >
> > >   michaelr_41@xxxxxxxxxxxxxx
> > >
> > > --
> > > http://www.fastmail.fm - And now for something completely different
> > > -----------------------------------------------------------------------
> > > This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> > > to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> > > -----------------------------------------------------------------------
> > --
> >
> >   michaelr_41@xxxxxxxxxxxxxx
> >
> > --
> > http://www.fastmail.fm - Sent 0.000002 seconds ago
> > -----------------------------------------------------------------------
> > This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> > to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> > -----------------------------------------------------------------------
> >
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> -----------------------------------------------------------------------
-- 
  
  michaelr_41@xxxxxxxxxxxxxx

-- 
http://www.fastmail.fm - Does exactly what it says on the tin
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------