src/Net/HTTP/Reader.php
public function post( $url, $data, $headers = array(), $curlOptions = array() )
	{
		$curl	= clone( $this->curl );
		$curl->setOption( CURLOPT_URL, $url );
		if( $headers )
		{
			if( $headers instanceof Net_HTTP_Header_Section )
				$headers	= $headers->toArray();
			$curlOptions[CURLOPT_HTTPHEADER]	= $headers;
		}
		$this->applyCurlOptions( $curl, $curlOptions );

		if( is_array( $data ) )
		{
			foreach( $data as $key => $value )														//  cURL hack (file upload identifier)
				if( is_string( $value ) && substr( $value, 0, 1 ) == "@" )							//  leading @ in field values
					$data[$key]	= "\\".$value;														//  need to be escaped
			$data	= http_build_query( $data, NULL, "&" );
		}
		$curl->setOption( CURLOPT_POST, TRUE );
		$curl->setOption( CURLOPT_POSTFIELDS, (string) $data );

		$response		= $curl->exec( TRUE, FALSE );
		$this->curlInfo	= $curl->getInfo();
		$response		= Net_HTTP_Response_Parser::fromString( $response );
		return $response;
	}
public function post( $url, $data, $headers = array(), $curlOptions = array() )
	{
		$curl	= clone( $this->curl );
		$curl->setOption( CURLOPT_URL, $url );
		if( $headers )
		{
			if( $headers instanceof Net_HTTP_Header_Section )
				$headers	= $headers->toArray();
			$curlOptions[CURLOPT_HTTPHEADER]	= $headers;
		}
		$this->applyCurlOptions( $curl, $curlOptions );

		if( is_array( $data ) )
		{
			foreach( $data as $key => $value )														//  cURL hack (file upload identifier)
				if( is_string( $value ) && substr( $value, 0, 1 ) == "@" )							//  leading @ in field values
					$data[$key]	= "\\".$value;														//  need to be escaped
			$data	= http_build_query( $data, NULL, "&" );
		}
		$curl->setOption( CURLOPT_POST, TRUE );
		$curl->setOption( CURLOPT_POSTFIELDS, (string) $data );

		$response		= $curl->exec( TRUE, FALSE );
		$this->curlInfo	= $curl->getInfo();
		$response		= Net_HTTP_Response_Parser::fromString( $response );
		return $response;
	}
public function post ( $ url , $ data , $ headers = array ( ) , $ curlOptions = array ( ) ) { $ curl = clone ( $ this -> curl ) ; $ curl -> setOption ( CURLOPT_URL , $ url ) ; if ( $ headers ) { if ( $ headers instanceof Net_HTTP_Header_Section ) $ headers = $ headers -> toArray ( ) ; $ curlOptions [ CURLOPT_HTTPHEADER ] = $ headers ; } $ this -> applyCurlOptions ( $ curl , $ curlOptions ) ; if ( is_array ( $ data ) ) { foreach ( $ data as $ key => $ value ) //  cURL hack (file upload identifier) if ( is_string ( $ value ) && substr ( $ value , 0 , 1 ) == "@" ) //  leading @ in field values $ data [ $ key ] = "\\" . $ value ; //  need to be escaped $ data = http_build_query ( $ data , NULL , "&" ) ; } $ curl -> setOption ( CURLOPT_POST , TRUE ) ; $ curl -> setOption ( CURLOPT_POSTFIELDS , ( string ) $ data ) ; $ response = $ curl -> exec ( TRUE , FALSE ) ; $ this -> curlInfo = $ curl -> getInfo ( ) ; $ response = Net_HTTP_Response_Parser :: fromString ( $ response ) ; return $ response ; }
Posts Data to Resource and returns Response.
@access		public
@param		string							$url			Resource URL
@param		array							$data			Map of POST Data
@param		array|Net_HTTP_Header_Section	$headers		Map of HTTP Header Fields or Header Section Object
@param		array							$curlOptions	Map of cURL Options
@return		Net_HTTP_Response
Posts Data to Resource and returns Response .