[Grok-dev] Re: Using POST request
Uli Fouquet
uli at gnufix.de
Mon Mar 24 12:38:08 EDT 2008
Hi there,
Andreas Jung wrote:
>
> --On 24. März 2008 12:02:21 +0100 Andreas Jung <lists at zopyx.com> wrote:
> Actually I get intercept a POST request using this approach. But:
>
> - sending a POST request through 'curl' works
> - POSTing to the same URL using 'python2.4 setup.py sdist upload -r URL'
> still fails with a 404
>
> The transcript recorded using Wireshark is here:
>
> <http://zopyx.com/tmp/sg.txt>
>
> So is there some issue with multipart/form-data?
Well, that seems to be setuptools specific. There's a form field::
----------------GHSKFJDLGDS7543FJKLFHRE75642756743254
Content-Disposition: form-data; name=":action"
file_upload
requiring an action called 'file_upload'. Because normal views are not
named that way, they cannot be found and this results in a 404 - file
not found.
So, your application must provide this 'action'. With views you should
be able to do it like this::
class FileUpload(grok.View):
grok.context(eggserver)
grok.name('file_upload') # Might do the trick...
def render(self):
return "Thanks for submitting."
Haven't tested it. Is something similar possible with REST?
Kind regards,
--
Uli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20080324/12e093ae/attachment.bin
More information about the Grok-dev
mailing list