Source/SabreAMF/Client.php
/**
         * sendRequest 
         *
         * sendRequest sends the request to the server. It expects the servicepath and methodname, and the parameters of the methodcall
         * 
         * @param string $servicePath The servicepath (e.g.: myservice.mymethod)
         * @param array $data The parameters you want to send
         * @return mixed 
         */
sendRequest
sendRequest sends the request to the server. It expects the servicepath and methodname, and the parameters of the methodcall

@param string $servicePath The servicepath
@param array $data The parameters you want to send
@return mixed
sendRequest sendRequest sends the request to the server . It expects the servicepath and methodname and the parameters of the methodcall @param string $servicePath The servicepath @param array $data The parameters you want to send @return mixed
public function sendRequest($servicePath,$data) {
            if($this->encoding & SabreAMF_Const::FLEXMSG) {
                $message = new SabreAMF_AMF3_RemotingMessage();
                $message->body = $data;
                $service = explode('.',$servicePath);
                $method = array_pop($service);
                $service = implode('.',$service);
                $message->operation = $method; 
                $message->source = $service;
                $data = $message;
            }
            $this->amfRequest->addBody(array(
                'target'   => $this->encoding & SabreAMF_Const::FLEXMSG?'null':$servicePath,
                'response' => '/1',
                'data'     => $data
            ));
            $this->amfRequest->serialize($this->amfOutputStream);
            $ch = curl_init($this->endPoint);
            curl_setopt($ch,CURLOPT_POST,1);
			curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
            curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_REFERER, 'http://www.trilulilu.ro');
            curl_setopt($ch,CURLOPT_TIMEOUT,20);
            curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-type: ' . SabreAMF_Const::MIMETYPE));
            curl_setopt($ch,CURLOPT_POSTFIELDS,$this->amfOutputStream->getRawData());
    		if ($this->httpProxy) {
    			curl_setopt($ch,CURLOPT_PROXY,$this->httpProxy);
    		}
            $result = curl_exec($ch);
            if (curl_errno($ch)) {
                throw new Exception('CURL error: ' . curl_error($ch));
                false;
            } else {
                curl_close($ch);
            }
            $this->amfInputStream = new SabreAMF_InputStream($result);
            $this->amfResponse = new SabreAMF_Message(); 
            $this->amfResponse->deserialize($this->amfInputStream);
            $this->parseHeaders();
            foreach($this->amfResponse->getBodies() as $body) {
                if (strpos($body['target'],'/1')===0) return $body['data'] ;
            }
        }
public function sendRequest ( $ servicePath , $ data ) { if ( $ this -> encoding & SabreAMF_Const :: FLEXMSG ) { $ message = new SabreAMF_AMF3_RemotingMessage ( ) ; $ message -> body = $ data ; $ service = explode ( '.' , $ servicePath ) ; $ method = array_pop ( $ service ) ; $ service = implode ( '.' , $ service ) ; $ message -> operation = $ method ; $ message -> source = $ service ; $ data = $ message ; } $ this -> amfRequest -> addBody ( array ( 'target' => $ this -> encoding & SabreAMF_Const :: FLEXMSG ? 'null' : $ servicePath , 'response' => '/1' , 'data' => $ data ) ) ; $ this -> amfRequest -> serialize ( $ this -> amfOutputStream ) ; $ ch = curl_init ( $ this -> endPoint ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( $ ch , CURLOPT_USERAGENT , 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13' ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; curl_setopt ( $ ch , CURLOPT_REFERER , 'http://www.trilulilu.ro' ) ; curl_setopt ( $ ch , CURLOPT_TIMEOUT , 20 ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , array ( 'Content-type: ' . SabreAMF_Const :: MIMETYPE ) ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ this -> amfOutputStream -> getRawData ( ) ) ; if ( $ this -> httpProxy ) { curl_setopt ( $ ch , CURLOPT_PROXY , $ this -> httpProxy ) ; } $ result = curl_exec ( $ ch ) ; if ( curl_errno ( $ ch ) ) { throw new Exception ( 'CURL error: ' . curl_error ( $ ch ) ) ; false ; } else { curl_close ( $ ch ) ; } $ this -> amfInputStream = new SabreAMF_InputStream ( $ result ) ; $ this -> amfResponse = new SabreAMF_Message ( ) ; $ this -> amfResponse -> deserialize ( $ this -> amfInputStream ) ; $ this -> parseHeaders ( ) ; foreach ( $ this -> amfResponse -> getBodies ( ) as $ body ) { if ( strpos ( $ body [ 'target' ] , '/1' ) === 0 ) return $ body [ 'data' ] ; } }
sendRequest
 sendRequest sends the request to the server.
sendRequest sendRequest sends the request to the server .
// We're using the FLEX Messaging framework // Setting up the message // We need to split serviceName.methodName into separate variables // If we're using the flex messaging framework, target is specified as the string 'null' ##test /*
			require '../Zebra_cURL.php';

$curl = new Zebra_cURL($this->endPoint);
$curl->cache('cache', 3600);
$curl->threads = 10;
$curl->option(array(
CURLOPT_CURLOPT_POST  =>  1,
CURLOPT_FOLLOWLOCATION  =>  TRUE,
CURLOPT_REFERER => 'http://www.trilulilu.ro',
CURLOPT_TIMEOUT => 20,
CURLOPT_HTTPHEADER => array('Content-type: ' . SabreAMF_Const::MIMETYPE),
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13',
CURLOPT_RETURNTRANSFER         =>  1,
CURLOPT_POSTFIELDS => $this->amfOutputStream->getRawData(),
));
$v=$curl->get($url);
$data=$v->body;
$result =   html_entity_decode($data);

##
*/ // The curl request