投稿

9月, 2016の投稿を表示しています

piwigo web api と curl

写真を探す ブラウザでアクセスする場合 http://localhost/piwigo/ws.php?format=rest&method=pwg.images.search&query=file=%2220121124090429_P1010220.JPG%22 curlでアクセスする場合 $ curl "http://localhost/piwigo/ws.php?format=rest&method=pwg.images.search&query=file=%2220121124090429_P1010220.JPG%22"  $ curl "http://localhost/piwigo/ws.php?format=rest&method=pwg.images.search&query=file="20121124090429_P1010220.JPG"" 状態を表示する curl http://localhost/piwigo/ws.php?format=json&method=pwg.session.getStatus 認証 クッキーに保存しないと別のセッションで使えない curl -c cookie.txt -d 'username=test&password=testtest' "http://192.168.2.2/piwigo/ws.php?format=json&method=pwg.session.login" 成功すれば  {"stat":"ok","result":true} が帰ってくる. セッションの確認 curl -b cookie.txt "http://192.168.2.2/piwigo/ws.php?format=json&method=pwg.session.getStatus" 成功すれば  {"username":"test","status&