I am attempting to upload a file that requires me to set a specific Content-Type for the API. When I do this:
file, err := os.Open("helloWorld.wav")
buf := new(bytes.Buffer)
writer := multipart.NewWriter(buf)
audioFile, _ := writer.CreateFormFile("file", "helloWorld.wav")
_, err = io.Copy(audioFile, file)
if err != nil {
return nil, 0, err
}
writer.Close()
It creates the multipart form properly, but assumes this content type:
Content-Type: application/octet-stream
I need to be able to set it to:
Content-Type: audio/wav;rate=8000
While of course I may set the headers for net/http, I am not seeing how to do this for individual fields in a multipart form.