概要

  • ウェブページを取得するライブラリ

サンプル

参考資料

インストール

  • apt-get install libcurl4-gnutls-dev

-d, -F の違い

https://qiita.com/att55/items/04e8080d1c441837ad42

  • d (--data) と -F (--Form) curl -X POST -d curl の POST オプションを -d (--data) とした場合、MIME type は application/x-www-form-urlencoded になります。 curl -X POST -d ‘name=taro’ curl -X POST -F 続いて -F (--Form) オプションを使う場合、MIME type は multipart/form-data になります。 curl -X POST -F ‘name=taro’ これら2つの MIME type が使われるシーンは主に HTML フォーム <form> を使う時です。

    form enctype="application/x-www-form-urlencoded"/>

    form enctype="multipart/form-data"/> では、違いは何でしょうか?

    https://davidwalsh.name/curl-post-file POSTing Files with cURL POSTing a file with cURL is slightly different in that you need to add an @ before the file location, after the field name:

    curl -X POST -F 'image=@/path/to/pictures/picture.jpg' http://domain.tld/upload


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-07-31 (日) 22:56:40 (634d)