Re: Using restclient for streaming multipart uploads


Anthony Rowlands <draftomatic@...>
 

I ran out of time myself, so hacked something together that is good enough for now with a straight stream instead of a multipart stream.

If you get ever find time to use StringIO with multipart, let me know, I'd be happy to have the solution since I pretty much spent all day today trying to get it working. =D This will suffice for the time being...

Thank you very much for your help!

Anthony R


On Wed, Nov 2, 2011 at 4:56 PM, Archiloque <code@...> wrote:
I think so but unfortunately I don't have tile now to retrieve it, for a quickfix you could write the StringIO to a TempFile and use it as a parameter

A.


Le 2 nov. 2011 à 23:44, Anthony Rowlands a écrit :

I just printed the raw request body on my server, and it is empty... The correct headers were sent, but there is nothing in the body.

Are you sure RestClient can handle this? You said it's not the first time someone has tried... Has anyone else gotten it to work? 

Anthony

On Wed, Nov 2, 2011 at 4:30 PM, Archiloque <code@...> wrote:

Le 2 nov. 2011 à 22:50, Anthony Rowlands a écrit :

Logging is showing this:

RestClient.post "http://localhost:8080/LightStanza/lsz-upload?projectKey=20", 30929 byte(s) length, "Accept"=>"*/*; q=0.5, application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Length"=>"30929", "Content-Type"=>"multipart/form-data; boundary=89514", "Cookie"=>"JSESSIONID=2DC341E5B9A96F8AE9DDB94267BA47F4"

Does this look okay to you? 30kb sounds about right for the data I'm testing with. It could be server-side problem at this point, but without seeing the actual stream it's hard to tell.

Also, do you see a problem with generating a random number for the file boundary? Seems like it's possible that this exact number would show up in the file content, which goes against the RFC.

seems difficult as you seem to have tried several time, you could perhaps use a simple logging proxy en your machine to see what exactly happen ?

A.




Join {main@rest-client.groups.io to automatically receive all group messages.