jonike / gorest

Automatically exported from code.google.com/p/gorest
0 stars 0 forks source link

Remove PostData, etc. have option of io.Reader/io.Writer #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
 1 Why need to specify the post data, params argument and output type?

    All of post data, params argument and output type can be found from function signature, using order in signature. That will allow to use type defined in other package more easily, like: http://play.golang.org/p/FUj-FXKr71

 2 Why Marshaller takes []byte instead of io.Reader/io.Writer?

    I think use io.Reader/io.Writer will much convenience for streaming io. Direct reading from request.Body or writing to responseWriter will also save a lot of memory if post or response is very large.

Original issue reported on code.google.com by siyabong...@gmail.com on 7 Mar 2013 at 9:24

GoogleCodeExporter commented 9 years ago
I've attached a patch for the Marshallers to use an io.Reader. I've internally 
used this for letting a large file stream down, rather then having to be fully 
read into memory.
Let me know what you think...

Original comment by forem...@gmail.com on 7 Jan 2014 at 8:32

Attachments: