Ticket #1849 (closed task: fixed)

Opened 2 years ago

Last modified 1 year ago

POST requests only support multipart/form-data

Reported by: tracguest Assigned to: bdelbosc
Priority: P2 Milestone: unspecified
Component: funkload Version: TRUNK
Severity: major Keywords:
Cc:

Description

It apears that WebUnit? only supports multipart/form-data for POST requests which is a fairly limitating perspective. It would be much appreciated and useful that any media-type is supported.

That should be actually easy by patching (again) WebUnit? and check for the content-type of the request, if different from multipart/form-data, simply send the whole content as-is.

This is a serious limitation to me.

Attachments

FL_ticket_1849.diff (3.1 kB) - added by tracguest on 07/08/07 10:49:47.

Change History

07/07/07 17:17:34 changed by tracguest

Alright it seems that the PatchWebUnit? module also provides support for urlencoded body. I will try to offer a patch to support any other content-type too :)

07/07/07 17:42:41 changed by tracguest

Here is a patch to FL that should allow POST requests for any content-type. Basically you can pass a dict, a byte string, a unicode string (which will be UTF-8 encoded, or a file object to the post() method.

In those cases you MUST set the Content-Type of the request via self.addHeader() before the call to self.post(). Feel free to adapt if needed.

It was created against the trunk HEAD.

07/08/07 10:49:47 changed by tracguest

  • attachment FL_ticket_1849.diff added.

07/24/08 22:45:08 changed by bdelbosc

  • status changed from new to closed.
  • resolution set to fixed.