With golang code I have to transfer file to remote service using their api. Their requirement is that request MUST NOT use multipart/form-data. I tried this curl command:
curl -i -X PUT -F filedata=@text.txt -H "Content-Type: text/plain" https://url.of.endpoint.com
it doesn't work since it simulates form, but this command:
curl -i -X PUT -T text.txt -H "Content-Type: text/plain" https://url.of.endpoint.com
works perfectly.
How can I translate this curl command to golang code?