[Grok-dev] Re: Using POST request

Andreas Jung lists at zopyx.com
Tue Mar 25 11:25:23 EDT 2008



--On 24. März 2008 17:38:08 +0100 Uli Fouquet <uli at gnufix.de> wrote:

> 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."
>


Tnx Uli - works perfectly for me.

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20080325/43965ec8/attachment.bin


More information about the Grok-dev mailing list