includes/http.php
changeset 1333 19b49910e81f
parent 1234 903bb153c265
equal deleted inserted replaced
1332:12286b3ee214 1333:19b49910e81f
   137  	*/
   137  	*/
   138 	
   138 	
   139 	var $parms_post = array();
   139 	var $parms_post = array();
   140 	
   140 	
   141 	/**
   141 	/**
       
   142 	* A string that can wholly replace the parameters in POST. If false, parameters are used as usual.
       
   143 	* @var mixed
       
   144 	*/
       
   145 	
       
   146 	var $post_string = false;
       
   147 	
       
   148 	/**
   142  	* The list of cookies that will be sent.
   149  	* The list of cookies that will be sent.
   143  	* @var array (associative)
   150  	* @var array (associative)
   144  	*/
   151  	*/
   145 	
   152 	
   146 	var $cookies_out = array();
   153 	var $cookies_out = array();
   339 		}
   346 		}
   340 		else
   347 		else
   341 		{
   348 		{
   342 			throw new Exception(__METHOD__ . ': Invalid argument(s)');
   349 			throw new Exception(__METHOD__ . ': Invalid argument(s)');
   343 		}
   350 		}
       
   351 	}
       
   352 	
       
   353 	/**
       
   354 	* Replace POST with a custom string, or false to use parameters through add_post().
       
   355 	* @param string
       
   356 	*/
       
   357 	
       
   358 	function set_post($str)
       
   359 	{
       
   360 		$this->post_string = $str;
   344 	}
   361 	}
   345 	
   362 	
   346 	/**
   363 	/**
   347  	* Internal function to open up the socket.
   364  	* Internal function to open up the socket.
   348  	* @access private
   365  	* @access private
   918 					$get .= "$name=$value";
   935 					$get .= "$name=$value";
   919 				else
   936 				else
   920 					$get .= "$name";
   937 					$get .= "$name";
   921 			}
   938 			}
   922 		}
   939 		}
   923 		if ( count($this->parms_post) > 0 )
   940 		if ( is_string($this->post_string) )
       
   941 		{
       
   942 			$post = $this->post_string;
       
   943 		}
       
   944 		else if ( count($this->parms_post) > 0 )
   924 		{
   945 		{
   925 			$post = '';
   946 			$post = '';
   926 			$i = 0;
   947 			$i = 0;
   927 			foreach ( $this->parms_post as $name => $value )
   948 			foreach ( $this->parms_post as $name => $value )
   928 			{
   949 			{