html - how to do post upload chunking(vs. download chunking) -


so, in playframework, can stream response when json request, can http chunking , stream response really large responses. wondering if same can done on post calls. if client has very large post call, can stream me request? possible html?

that said, if can't that, need api curl or other non-browser client use upload file(the json request, or csv, etc). how create such api?

i should note cannot receive whole request @ once or out of memory. need receive pieces , receive pieces put backend datastore piece @ time.

also, curl syntax make sure streaming file rather sending in 1 huge huge request break server? how force client stream file in?

thanks, dean

you can full control on http request processing using essentialaction. essentialaction processes request body , returns result.

normal play actions special case of essentialaction. actions process request bodies , return results too, perform processing in 2 steps. actions first parse request body. actions parsethe parsed value function result. you, having separate parsing step problem because means parsed value needs stored in memory.

if use essentialaction can avoid storing parsed value in memory, because can process request body arrives.

what need add method controller returns essentialaction.

the signature of essentialaction is:

trait essentialaction extends (requestheader) ⇒ iteratee[array[byte], simpleresult]  

the essentialaction needs accept request header , return iteratee process request body. iteratee incrementally process request body arrives. can use iteratee put each piece data store each piece arrives. when you're done processing pieces can return result.

more info here: http://www.playframework.com/documentation/2.2.x/httpapi.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -