Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php	(revision 7986)
+++ wp-includes/pluggable.php	(working copy)
@@ -1445,4 +1445,99 @@
 }
 endif;
 
+if( ! function_exists('remote_http') ){
+/**
+ * remote_http() - makes a HTTP/1.0 request.
+ *
+ * Makes a remote HTTP request and returns a object repreenting the request.
+ * Please note that this function does not support Proxies, Is not cached, And times out on the connection attempt after 3 seconds.
+ *
+ * The headers sent by this function can be modified/added to by the 'remote_http_headers' filter.
+ * All headers returned by this function are normalised to lowercase, Content is not modified.
+ *
+ * @since 2.6
+ *
+ * @param string $url the URL to open
+ * @param string $method (optional) the HTTP method for the connection, Accepts GET, POST or HEAD
+ * @param string|array $data (optional) an Associative array containing data keys to be sent, or a pre-made HTTP query string
+ * @param array $headers (optional) Extra headers to send with the connection. eg. array('Referer' => 'http://localhost/');
+ * @return bool|object Returns false on failure, Else an object with 4 properties: "stauts", "statusname", "headers" and "content"
+ */
+function remote_http($url, $method='GET', $data='', $headers = array()){
+	//Note: This returns all headers in lowercase.
+	global $wp_version;
+	
+	if( ! function_exists('fsockopen') )
+		return false;
+	
+	if( is_array($data) )
+		$data = http_build_query($data);
+
+	if( ! is_array($headers) )
+		$headers = array();
+
+	$allowed_methods = array('GET', 'POST', 'HEAD');
+	if( ! in_array($method, $allowed_methods) )
+		$method = 'GET';
+
+	$port = 80;
+	$schema = 'http';
+	$path = $host = $query = '';
+	$parts = parse_url($url);
+	extract($parts);
+
+	if( ! empty($query) )
+		$query = "?$query";
+	
+	$http_request  = "$method $path$query HTTP/1.0\r\n";
+	$http_request .= "Host: $host\r\n";
+
+	if( ! isset($headers['User-Agent']) )
+		$headers['User-Agent'] = 'WordPress/' . $wp_version . '; ' . get_bloginfo('url');
+
+	if( ! empty($data) ) {
+		$headers['Content-Length'] = strlen($data);
+		
+		if( ! isset($headers['Content-Type']) )
+			$headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset');
+	}
+
+	$headers = apply_filters('remote_http_headers', $headers);
+	
+	if( ! empty($headers) )
+		foreach($headers as $header => $value)
+			$http_request .= "$header: $value\r\n";
+
+	$http_request .= "\r\n";
+	if( ! empty($data) )
+		$http_request .= $data;
+
+	$response = '';
+	if( false == ( $fs = @fsockopen( $host, $port, $errno, $errstr, 3) ) || ! is_resource($fs) )
+		return false;
+
+	fwrite($fs, $http_request);
+
+	while ( !feof($fs) )
+		$response .= fgets($fs, 1160); // One TCP-IP packet
+	fclose($fs);
+	$response = explode("\r\n\r\n", $response, 2);
+	
+	$ret = (object)array('status' => 0, 'statusvalue' => '', 'headers' => array(), 'content'=> $response[1]);
+
+	foreach( explode("\n", $response[0]) as $rheader) {
+		if( strpos($rheader, ':') ) { //Proper header
+			list($header, $value) = explode(':', $rheader, 2);
+			if( !empty($header) && ! empty($value) )
+				$ret->headers[ strtolower(trim($header)) ] = trim($value);
+		} else if( strpos($rheader, 'HTTP') > -1) { //A Status header.
+			list(,$status, $status_value) = preg_split('|\s+|', $rheader,3);
+			$ret->status = trim($status);
+			$ret->statusvalue = trim($status_value);
+		}
+	}
+
+	return $ret;
+}
+}
 ?>
