title: "File with content-type application/octet-stream is not supported" returned on sending CSV file in Golang
body: <p>On making an API call to and endpoint in Golang I am passing CSV file as :</p>
  <pre><code>payload := &amp;bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  
  file, _ := os.Open(&quot;temp.csv&quot;)
  defer file.Close()
  part3,
      errFile3 := writer.CreateFormFile(&quot;file&quot;, filepath.Base(&quot;temp.csv&quot;))
  _, errFile3 = io.Copy(part3, file)
  if errFile3 != nil {
      fmt.Println(errFile3)
      return
  }
  _ = writer.Close()
  req, _ := http.NewRequest(&quot;POST&quot;, url, payload)
  req.Header.Set(&quot;Content-Type&quot;, writer.FormDataContentType())
  </code></pre>
  <p>But it is returning :</p>
  <pre><code>File with content-type application/octet-stream is not supported
  </code></pre>
  <p>But on making the same call from POSTMAN it is succeeding? Has anyone faced this?</p>
  <p>Is there any way of passing content type as &quot;text/csv&quot; in Golang for file?</p>