phpの下記のfunction helloActionにphpからデータを送りたいのですがurlはどのように書けばよろしいのでしょうか。
http://xxx.com/hoge/helloを直接ブラウザに叩いてもnot faundになってしまいます。
php
1//送るphp 2$url = "http://xxx.com/hoge/hello"; 3$data = array( 4 'url_name' => $url_name, 5 'password' => $password 6); 7$content = http_build_query($data); 8$options = array('http' => array( 9 'method' => 'POST', 10 'content' => $content 11)); 12$contents = file_get_contents($url, false, stream_context_create($options));
php
1受け取る側 2<?php 3 4class HogeController 5{ 6 public function helloAction() 7 { 8 //データの取得 9 } 10}
フレームワークは何かお使いでしょうか。また、リクエストされたurlに対するコントローラのルート設定はどのようにされていますか。