src/url_fetcher.php
function post($data = "",$options = array()){
		if(is_array($data)){
			$d = array();
			foreach($data as $k => $v){
				$d[] = urlencode($k)."=".urlencode($v);
			}
			$data = join("&",$d);
		}

		$options = array_merge(array(
			"content_type" => "application/x-www-form-urlencoded",
			"additional_headers" => array(),
		),$options);

		$this->_RequestMethod = "POST";
		$this->_PostData = $data;
		$this->_AdditionalHeaders = $options["additional_headers"];
		$this->_AdditionalHeaders[] = "Content-Type: $options[content_type]";

		return $this->fetchContent();
	}
function post($data = "",$options = array()){
		if(is_array($data)){
			$d = array();
			foreach($data as $k => $v){
				$d[] = urlencode($k)."=".urlencode($v);
			}
			$data = join("&",$d);
		}

		$options = array_merge(array(
			"content_type" => "application/x-www-form-urlencoded",
			"additional_headers" => array(),
		),$options);

		$this->_RequestMethod = "POST";
		$this->_PostData = $data;
		$this->_AdditionalHeaders = $options["additional_headers"];
		$this->_AdditionalHeaders[] = "Content-Type: $options[content_type]";

		return $this->fetchContent();
	}
function post ( $ data = "" , $ options = array ( ) ) { if ( is_array ( $ data ) ) { $ d = array ( ) ; foreach ( $ data as $ k => $ v ) { $ d [ ] = urlencode ( $ k ) . "=" . urlencode ( $ v ) ; } $ data = join ( "&" , $ d ) ; } $ options = array_merge ( array ( "content_type" => "application/x-www-form-urlencoded" , "additional_headers" => array ( ) , ) , $ options ) ; $ this -> _RequestMethod = "POST" ; $ this -> _PostData = $ data ; $ this -> _AdditionalHeaders = $ options [ "additional_headers" ] ; $ this -> _AdditionalHeaders [ ] = "Content-Type: $options[content_type]" ; return $ this -> fetchContent ( ) ; }
Performs a POST request

@param mixed $data when array it is sent as query parameters, otherwise $data is sent without processing
@param array $options
- content_type string - value for Content-Type HTTP header
- additional_headers array - more headers
@return bool result of request
Performs a POST request