私はcURLの使い方について簡単な質問があります。私のGoogle検索やマニュアルページでは分かりにくい答えが得られませんでした。cURL POST - データバイナリvs --form
here--data
対--form
のいずれかを使用してファイル/添付ファイルを送信します。私は主な違いは何か、あなたが選ぶだろうシナリオを知りたいのですが、好奇心が強いです--data-binary
VS --form
?
POST「ボディ」--data (for application/x-www-form-urlencoded)
又は--form (for multipart/form-data)
のいずれかを介して送信することができる:正確主な違いです
-F "foo=bar" # 'foo' value is 'bar'
-F "foo=<foovalue.txt" # the specified file is sent as plain text input
-F "[email protected]" # the specified file is sent as an attachment
-d "foo=bar"
-d "foo=<foovalue.txt"
-d "[email protected]"
-d "@entirebody.txt" # the specified file is used as the POST body
--data-binary "@binarybody.jpg"
ありがとうございました! いずれのタイプのデータを使用するシナリオは何ですか? 'form-urlencoded'はリクエストにデータを埋め込むためのものですが、multipartは異なっていますか? – xbeta