protected function send($content)
    {
        $url = sprintf('https://%s/%s/%s/%s', self::HOST, self::ROOMS_ENDPOINT, $this->roomId, self::MESSAGES_ENDPOINT);
        $data = json_encode(array('text' => $content));
        $headers = array(
            'Content-Type: application/json',
            'Accept: application/json',
            "Authorization: Bearer {$this->token}"
        );

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        curl_exec($ch);
        curl_close($ch);
    }
protected function send($content)
    {
        $url = sprintf('https://%s/%s/%s/%s', self::HOST, self::ROOMS_ENDPOINT, $this->roomId, self::MESSAGES_ENDPOINT);
        $data = json_encode(array('text' => $content));
        $headers = array(
            'Content-Type: application/json',
            'Accept: application/json',
            "Authorization: Bearer {$this->token}"
        );

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        curl_exec($ch);
        curl_close($ch);
    }
protected function send ( $ content ) { $ url = sprintf ( 'https://%s/%s/%s/%s' , self :: HOST , self :: ROOMS_ENDPOINT , $ this -> roomId , self :: MESSAGES_ENDPOINT ) ; $ data = json_encode ( array ( 'text' => $ content ) ) ; $ headers = array ( 'Content-Type: application/json' , 'Accept: application/json' , "Authorization: Bearer {$this->token}" ) ; $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_POST , true ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ data ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , $ headers ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_exec ( $ ch ) ; curl_close ( $ ch ) ; }
Send content to a gitter.im chat room through the rest api.

@param string $content
@see https://developer.gitter.im/docs/messages-resource
Send content to a gitter . im chat room through the rest api .