LoginSignup
9
5

More than 5 years have passed since last update.

curlでmultipart post時にファイルのContent-Typeを指定する方法

Posted at

multipartはContent-TypeがContent-Type: multipart/form-dataなのでheaderオプションでContent-Typeを上書きしてしまうと意図した動きにならない。

postするファイルのContent-Typeを指定する場合は@fileの後ろにtypeで指定する。

curl -F "file=@file.caf;type=audio/x-caf" ...
9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5