[Zope] POST to zope

Paul Zwarts paz@oratrix.com
Wed, 11 Jul 2001 12:03:00 +0200


Great Steve,
Thanks for the wonderfull suggestions. I'm now resinspired to check this
out.

The <dtml-if> was only an example of a form in Zope. We will check into your
hypothetical question regarding Shockwave's awareness.

Thanks for your help,
Paul Zwarts

-----Original Message-----
From: Steve Spicklemire [mailto:steve@spvi.com]
Sent: Wednesday, July 11, 2001 12:00 PM
To: Paul Zwarts
Cc: Zope
Subject: Re: [Zope] POST to zope



Hi Paul,

	Well *thats* a horse of a different color! Seriously, I know from
painful experience that shockwave/flash on Windows is broken as far as
XML post is concerned (I've pasted my bug report to Macromedia at the
end of this message) but it doesn't sound like this is your problem. For
issues like this I would recommend

webdebug (http://www.cyberclip.com/webdebug/download.html) or

Shane's excellent TCPWatch
(http://www.zope.org/Members/hathawsh/tcpwatch)

The ZMI is full of 'POSTS' so it's pretty clear that POST works! I'm a
little suspicious of your "if":

<dtml-if "REQUEST.has_key('submit')">
  do something
</dtml-if>

How do you know that shockwave is sending a form element with name="submit"?

-steve

Here is my post to Macromedia on the subject:

=======================
Your Name: Steve Spicklemire
Your E-Mail:steve@spvi.com
=======================
Bug Description
=======================
Summary: XMLObject.sendAndLoad really does "GET" on Windows

Steps to Reproduce:

1. in ActionScript create an XML object then sendAndLoad to an URL

2. Watch the TCP/IP protocol with a protocol sniffing program or proxy.

Expected Results:

According to the documentation sendAndLoad should perform a 'post'
operation. The Mac version of Flash player does this correctly. Here is
a tcpdump example:

tcpdump -X host tce and dst port 9080

06:18:26.689654 10.0.0.15.49784 > hs243.spvi.com.9080: P
3779844854:3779845148(294) ack 3107675499 win 32768 (DF)
0x0000   4500 014e 240a 4000 ff06 bf19 0a00 000f        E..N$.@.........
0x0010   4084 4cf3 c278 2378 e14b daf6 b93b 5d6b        @.L..x#x.K...;]k
0x0020   5018 8000 5bba 0000 504f 5354 202f 6d65        P...[...POST./me
0x0030   6469 614d 6173 7465 722f 696e 6465 785f        diaMaster/index_
0x0040   786d 6c20 4854 5450 2f31 2e30 0d0a 4163        xml.HTTP/1.0..Ac
0x0050   6365                                           ce

Actual Results:

On windows sendAndLoad is performing a "GET" rather than a "POST":

tcpdump -X host tce and dst port 9080

06:21:38.202937 vh10-12.spvi.com.1045 > hs243.spvi.com.9080: P
0:252(252) ack 1 win 8760 (DF)
0x0000   4500 0124 3301 4000 8006 2f50 0a00 000c        E..$3.@.../P....
0x0010   4084 4cf3 0415 2378 002c 6362 b582 5380        @.L...#x.,cb..S.
0x0020   5018 2238 3ba6 0000 4745 5420 2f6d 6564        P."8;...GET./med
0x0030   6961 4d61 7374 6572 2f69 6e64 6578 5f78        iaMaster/index_x
0x0040   6d6c 2048 5454 502f 312e 310d 0a43 6f6e        ml.HTTP/1.1..Con
0x0050   7465                                           te

=======================
Platform:
Power Macintosh___X_____
Windows 95/98___X____
Windows NT________
Windows 2000________
Windows ME________
=======================
Browser Information:
=======================
Browser: Any
Browser Version:
=======================
System Information:
=======================
Hardware: For MacOS B&W 400Mhz, For Windows 800Mhz HP
OS Version: MacOS 9.1, Win98
RAM: Mac: 384M, Win 128M
=======================

Paul Zwarts wrote:
>
> Hi Steve,
>
> I understand this well enough, but I have seen in two different scenarios
> that this fundamentally does not work.
>
> A transaction system we built has a system that is beyond my understanding
> and responsibility. The technicians assured me that they tried to POST
data
> to a form from their server to our zope. It for some reason didnt work.
> (This is work previous to my time in the company)
>
> In my own test with Shockwave, using a POST method, the form does not
> process. Using a GET with a query string of course, DOES trigger zope
> properly. But perhaps its my logic gating in the form?
>
> Obsserve in ZOPE only:
> Name :index_html
>
> <dtml-if "REQUEST.has_key('submit')">
>   do something
> </dtml-if>
>
> <form method=POST>
>   <input type=Submit name=submit>
> </form>
>
> Easy enough, yes? Now take something non-zope and try to post the submit.
> The 'do something' never occurs and nothing suggests that there was an
> error. Simply a zero-byte response.
>
> Does this explain my problem better?
>
> Thanks for your help,
> Paul Zwarts
>
> -----Original Message-----
> From: Steve Spicklemire [mailto:steve@spvi.com]
> Sent: Wednesday, July 11, 2001 11:30 AM
> To: Paul Zwarts
> Cc: Zope
> Subject: Re: [Zope] POST to zope
>
> Hi Paul,
>
>         Hmm.. you have a form that uses 'method="POST"'? POST/GET are just
> different ways of encoding variables that get sent with a REQUEST to
> Zope. GET encodes the variables as part of the URL, POST sends them
> after all the headers are finished. Zope handles the distinction by
> parsing the variables (however they were sent) and stores them in the
> REQUEST object, which can then be interrogated by your methods.
>
> does that help?
> -steve
>
> Paul Zwarts wrote:
> >
> > Can someone suggest a document somewhere that outlines Zope mechanism
for
> > POST and GET? I'm trying to make POSTs to Zope from elsewhere without
any
> > ideas of how to go about it.
> >
> > Thanks,
> > Paul Zwarts
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )