I just need to know an extremely simple way to send a file to a remote server using HTTP POST, in Go. I have already tried so many complicated methods with no luck. My curl command is this:
curl https://api.example.com/upload \
--user api:YOUR_API_KEY \
--data-binary @file.jpg \
--dump-header apiresponse.txt
I would prefer something without using multipart. I would also prefer something which uses io.Reader, so that I can later implement a progress bar easily.
os.Open
This was the missing simplicity that I was looking for. It worked.