Currently in order to POST a multipart message, I create a temporary file and upload that. However, instead of requiring a file to be created on disk, there should be a mechanism to allow arbitrary data sources that implement a common interface. I propose https://golang.org/pkg/mime/multipart/#File.
type File interface {
io.Reader
io.ReaderAt
io.Seeker
io.Closer
}
This exposes enough information to construct the body buffer I use in the http library. This way, I can write a filestring as follows:
@smasher164 Sorry for posting it here, but I can't find any information. Could you please teach me how to upload files using existing version of surf? Thanks in advance!
Currently in order to POST a multipart message, I create a temporary file and upload that. However, instead of requiring a file to be created on disk, there should be a mechanism to allow arbitrary data sources that implement a common interface. I propose https://golang.org/pkg/mime/multipart/#File.
This exposes enough information to construct the body buffer I use in the http library. This way, I can write a
filestring
as follows: