lib/DetectLanguage/Client.php
protected static function requestStream($url, $params)
    {
        $opts = array('http' =>
            array(
                'method' => 'POST',
                'header' => implode("\n", self::getHeaders()),
                'content' => json_encode($params),
                'timeout' => self::$requestTimeout,
                'ignore_errors' => true,
            )
        );

        $context = stream_context_create($opts);

        return file_get_contents($url, false, $context);
    }
protected static function requestStream($url, $params)
    {
        $opts = array('http' =>
            array(
                'method' => 'POST',
                'header' => implode("\n", self::getHeaders()),
                'content' => json_encode($params),
                'timeout' => self::$requestTimeout,
                'ignore_errors' => true,
            )
        );

        $context = stream_context_create($opts);

        return file_get_contents($url, false, $context);
    }
Perform request using native PHP streams

@param string $url Request URL
@param array $params The parameters to use for the POST body

@return string Response body