public function post( $url, $request) 
	{
		$curl = curl_init();
		$options = (array) $this->options + array(
			CURLOPT_RETURNTRANSFER => 1,
			CURLOPT_URL            => $url,
			CURLOPT_POST           => true,
			CURLOPT_POSTFIELDS     => $request,
			CURLOPT_HEADER         => true
		);
		curl_setopt_array( $curl, $options );
		$contents = curl_exec( $curl );
		$headerSize = curl_getinfo( $curl, CURLINFO_HEADER_SIZE );
		$this->responseHeaders = substr( $contents, 0, $headerSize );
		$contents = substr( $contents, $headerSize );

		if ( curl_errno( $curl ) ) 
		{
			$errorNumber = curl_errno( $curl );
			$errorMessage = curl_error( $curl );
			curl_close( $curl );
			$version = explode('.', phpversion() );
			if (!$this->_skipPreviousException) { // previousException supported in php >= 5.3
				$exception = new Ripcord_TransportException( 'Could not access ' . $url
					, ripcord::cannotAccessURL
					, new Exception( $errorMessage, $errorNumber ) 
				);
			} else {
				$exception = new Ripcord_TransportException( 'Could not access ' . $url 
					. ' ( original CURL error: ' . $errorMessage . ' ) ',
					ripcord::cannotAccessURL
				);
			}
			throw $exception;
		}
		curl_close($curl);
		return $contents;
	}
public function post( $url, $request) 
	{
		$curl = curl_init();
		$options = (array) $this->options + array(
			CURLOPT_RETURNTRANSFER => 1,
			CURLOPT_URL            => $url,
			CURLOPT_POST           => true,
			CURLOPT_POSTFIELDS     => $request,
			CURLOPT_HEADER         => true
		);
		curl_setopt_array( $curl, $options );
		$contents = curl_exec( $curl );
		$headerSize = curl_getinfo( $curl, CURLINFO_HEADER_SIZE );
		$this->responseHeaders = substr( $contents, 0, $headerSize );
		$contents = substr( $contents, $headerSize );

		if ( curl_errno( $curl ) ) 
		{
			$errorNumber = curl_errno( $curl );
			$errorMessage = curl_error( $curl );
			curl_close( $curl );
			$version = explode('.', phpversion() );
			if (!$this->_skipPreviousException) { // previousException supported in php >= 5.3
				$exception = new Ripcord_TransportException( 'Could not access ' . $url
					, ripcord::cannotAccessURL
					, new Exception( $errorMessage, $errorNumber ) 
				);
			} else {
				$exception = new Ripcord_TransportException( 'Could not access ' . $url 
					. ' ( original CURL error: ' . $errorMessage . ' ) ',
					ripcord::cannotAccessURL
				);
			}
			throw $exception;
		}
		curl_close($curl);
		return $contents;
	}
public function post ( $ url , $ request ) { $ curl = curl_init ( ) ; $ options = ( array ) $ this -> options + array ( CURLOPT_RETURNTRANSFER => 1 , CURLOPT_URL => $ url , CURLOPT_POST => true , CURLOPT_POSTFIELDS => $ request , CURLOPT_HEADER => true ) ; curl_setopt_array ( $ curl , $ options ) ; $ contents = curl_exec ( $ curl ) ; $ headerSize = curl_getinfo ( $ curl , CURLINFO_HEADER_SIZE ) ; $ this -> responseHeaders = substr ( $ contents , 0 , $ headerSize ) ; $ contents = substr ( $ contents , $ headerSize ) ; if ( curl_errno ( $ curl ) ) { $ errorNumber = curl_errno ( $ curl ) ; $ errorMessage = curl_error ( $ curl ) ; curl_close ( $ curl ) ; $ version = explode ( '.' , phpversion ( ) ) ; if ( ! $ this -> _skipPreviousException ) { // previousException supported in php >= 5.3 $ exception = new Ripcord_TransportException ( 'Could not access ' . $ url , ripcord :: cannotAccessURL , new Exception ( $ errorMessage , $ errorNumber ) ) ; } else { $ exception = new Ripcord_TransportException ( 'Could not access ' . $ url . ' ( original CURL error: ' . $ errorMessage . ' ) ' , ripcord :: cannotAccessURL ) ; } throw $ exception ; } curl_close ( $ curl ) ; return $ contents ; }
This method posts the request to the given url
@param string $url The url to post to.
@param string $request The request to post.
@throws Ripcord_TransportException (ripcord::cannotAccessURL) when the given URL cannot be accessed for any reason.
@return string The server response
This method posts the request to the given url