Re: [Zope] Raw post data

2001-01-14 Thread Dieter Maurer

Shai Berger writes:
 > For several reasons, I would like to have direct access to raw posted 
 > data in my dtml-code (an analogue of QUERY_STRING). Can anyone please
 > show me the light?
"REQUEST['BODY']" may work.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Raw post data

2001-01-14 Thread Steve Spicklemire


Hi Shai,

   This external method works for me.

-steve

--

def getRawInput(self, REQUEST):

meth = REQUEST.environ.get('REQUEST_METHOD','GET')

if meth != 'GET':
REQUEST.stdin.seek(0)
result = REQUEST.stdin.read()
else:
result = REQUEST.environ.get('QUERY_STRING','')

return result

#
# Test functions..
#
if __name__=='__main__':

import StringIO

class Foo:
pass

REQUEST = Foo()
REQUEST.environ =  {'REQUEST_METHOD':'GET', 'QUERY_STRING':"Yup.. it's a query 
string."}
print getRawInput(None, REQUEST)

REQUEST = Foo()
REQUEST.environ =  {'REQUEST_METHOD':'POST'}
REQUEST.stdin = StringIO.StringIO()
REQUEST.stdin.write("It's a streamed input ")

print getRawInput(None, REQUEST)



___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] Raw post data

2001-01-14 Thread Shai Berger

Hi guys,

For several reasons, I would like to have direct access to raw posted 
data in my dtml-code (an analogue of QUERY_STRING). Can anyone please
show me the light?

Thanks,
Shai.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )