8.8.1 get
The original text for this section has changed since it was translated. Please help resolve this difference. You can:
get メソッドはシンプルな HTTP GET のリクエストを作成し、リクエストの結果を返します。
string function get ($uri, $query, $request)
$uri はリクエストを行うウェブアドレス、$query はクエリ文字列のパラメータです。クエリは、文字列で "param1=foo¶m2=bar" としても、キー付きの配列で配列で array('param1' => 'foo', 'param2' => 'bar') というようにしても、どちらでもかまいません。
App::import('Core', 'HttpSocket');
$HttpSocket = new HttpSocket();
$results = $HttpSocket->get('www.google.com/search', 'q=cakephp');
//Google で "cakephp" を検索した結果の HTML が返ります
App::import('Core', 'HttpSocket');$HttpSocket = new HttpSocket();$results = $HttpSocket->get('www.google.com/search', 'q=cakephp');//Google で "cakephp" を検索した結果の HTML が返ります


























