grequests icon indicating copy to clipboard operation
grequests copied to clipboard

how to post a file using file received from gin's c.FormFile?

Open aurorazl opened this issue 5 years ago • 2 comments

I received a file through gin's c.FormFile. file, err := c.FormFile("image") How can i send it to other server through grequests? Thanks.

aurorazl avatar Jul 15 '20 13:07 aurorazl

Can grequests post a file from []byte or string?

aurorazl avatar Jul 16 '20 01:07 aurorazl

Solved it! []grequests.FileUpload{{FileName: "image",FileContents: ioutil.NopCloser(bytes.NewReader(image))}

aurorazl avatar Jul 16 '20 08:07 aurorazl