nandlabs / go-commons

A common collection of utilities for Go programming language
Apache License 2.0
2 stars 2 forks source link

add multipart support in rest client #20

Closed neo7337 closed 1 year ago

nandagopalan commented 1 year ago

May be a Request#SetMultiPartFile(filename, params map[string]string) can be created .

nandagopalan commented 1 year ago

@neo7337 Does It make sense to use vfs here ?

neo7337 commented 1 year ago

Don't think so vfs involvement should be necessary, we are just adding the files to the request to be read by the server. Adding the files to the request can be something like this:-

  1. read the file from the client location
  2. create a stream
  3. via reader set the file stream to the multipart object with the provided param name of the file

lemme know if I am making sense!

nandagopalan commented 1 year ago

The only reason I was thinking vfs is because then it'll allow remote to remote file upload. It's going to be tricky but we can park it and support local file for the time being.