POST

Kohana で POST メソッドを利用する。

http://localhost/kohana/ を Kohana のルートとする POST データを投げる URL は http://localhost/kohana/index.php/post/recieve/ とする。コントローラー名は「post」、メソッド名は「recieve」となる。 post.html <form method="post" action="/kohana/index.php/post/recieve/"> <label for="mail">メールアドレス<br /> <input id="mail" type="text" name="mail"></label></form>

wget を利用して POST メソッドを利用する

例文。 % wget --post-data 'user=fizz&password=bazz' https://www.example.com/ 上記の例文とは異なる記述を見つけたので、要調査。 $ wget --post-data '<thread thread="1181906758" version="20061206" res_from="0" />' http://msg22.nicovideo.jp/api/ wget で POST 追記 リンク先の管理者の方から、上記例文は動作し</thread>…

サンプルコード

require 'open-uri' open('http://www.example.com/', { :method => :post, :body => 'a=123&b=456', 'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12', 'Accept' => 'text/xml,application/x…