hzl512 / poster-extension

Automatically exported from code.google.com/p/poster-extension
0 stars 0 forks source link

Feature : send a multipart/form-data content #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be an interesting feature to be able to generate and send a
multipart/form-data content, (but this may need lots of UI development)

At least, it would be great to be able to insert CR-LF (\r\n) into the
request body to meet multipart/form-data specifications.

Thanks

Original issue reported on code.google.com by reywil...@gmail.com on 1 Dec 2009 at 11:14

GoogleCodeExporter commented 8 years ago
I'm not sure this is possible with the API I'm using.  I'll have to research 
this.

Original comment by alexmilo...@gmail.com on 16 Feb 2010 at 5:15

GoogleCodeExporter commented 8 years ago
I've got sending an empty multipart/form-data with the extension, but when 
putting
content it always fail.
Content-Type:multipart/form-data; boundary=aaaa
Content: --aaaa--

And works fine. Once i put a content like:
--aaaa
Content-Disposition: form-data; name="Test.txt"; filename="Test.txt"
Content-Type: text/plain

asdfaesfasdf adsf asdf asdf asdf
--aaaa--

Fails.

Original comment by useyour....@gmail.com on 14 May 2010 at 7:59

GoogleCodeExporter commented 8 years ago
I sent a file with multipart/form-data without a problem.

Fill the Content-Type field with:

multipart/form-data; boundary=AaB03x

In the textarea you have to insert:

--AaB03x
Content-Disposition: form-data; name="files";
filename="filename.txt"
Content-Type: text/xml

...file content...

--AaB03x--

Original comment by crea...@mindcreations.com on 3 Feb 2011 at 5:06

GoogleCodeExporter commented 8 years ago
Great! I'll try that!

Original comment by reywil...@gmail.com on 3 Feb 2011 at 5:10

GoogleCodeExporter commented 8 years ago
I'm trying to use Poster to test a servlet using Apache Commons FileUpload.  
When I set it up as above, I get a 
"org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly" 
error.  Any thoughts on why?

Original comment by sd...@shaw.ca on 10 Aug 2011 at 9:02