public function request_url($params) { $fed = new FederationSocket(); $user = json_decode($fed->send(null, "http://localhost", 'GET'), true); return $user; // $ch = curl_init("http://localhost:8080"); // $fp = fopen("example_homepage.txt", "w"); // curl_setopt($ch, CURLOPT_FILE, $fp); // curl_setopt($ch, CURLOPT_HEADER, 0); // return curl_exec($ch); // curl_close($ch); // fclose($fp); }
public static function send($service, $url, $method, $args = array(), $failonerror = 1) { if (!($failonerror === 0 || $failonerror === 1)) { $msg = $msg_http = "Bad parameter value: " . $failonerror; throw new Error(400, $msg, __FILE__, __METHOD__, __LINE__, $msg_http); } return FederationSocket::execute($url, $method, $args, $failonerror); }