HTTP-Easy icon indicating copy to clipboard operation
HTTP-Easy copied to clipboard

POST with file uploads is broken

Open supernovus opened this issue 12 years ago • 4 comments

Not sure how long this has been broken, but yeah, if you try to use a multipart/form-data POST with a file attachment, stuff breaks, badly.

supernovus avatar Mar 26 '13 00:03 supernovus

Hey supernovus!

Actually masak and I figured out that POST requests doesn't work at all.

I guess it's because of .get which returns only the first line (here: https://github.com/supernovus/perl6-http-easy/blob/master/lib/HTTP/Easy.pm6#L57) and later we want to extract the header from what we've just .get - which is incorrect. Going further we can't read the content because we dont have the Content-Length field and so on... :)

supernovus++ # a lot of work done

sergot avatar Aug 05 '14 18:08 sergot

I due seem to remember planning on a rewrite of a bunch of these libraries. I'm guessing this is one that is in need of some fairly substantial changes in order to work as expected.

supernovus avatar Aug 06 '14 00:08 supernovus

I will try to find some time to fix this. :)

.recv would help, then some refactoring and.. we'll see.

sergot avatar Aug 06 '14 07:08 sergot

Quick solution: https://github.com/supernovus/perl6-http-easy/commit/7a6b55353c1f5d4176a5a0d8f7fea41d93f57d4a should be enough, take a look.

We should check this commit, it may contain some redundant code or something. :)

sergot avatar Aug 06 '14 13:08 sergot