對於以前的項目我已經使用建議有一個良好的PHP HTTP類
/**
* HTTP Class
*
* This is a wrapper HTTP class that uses either cURL or fsockopen to
* harvest resources from web. This can be used with scripts that need
* a way to communicate with various APIs who support REST.
*
* @author Md Emran Hasan <[email protected]>
* @package HTTP Library
* @copyright 2007-2008 Md Emran Hasan
* @link http://www.phpfour.com/lib/http
* @since Version 0.1
*/
這工作得很好,但沒有出現已在相當長的一段時間(確實已經更新,上面的鏈接甚至沒有現在的工作...)。我最近的項目將大量使用http方法(訪問跨域和內部API),所以我需要確保儘可能高效地使用http類/庫。
你對此功能有什麼用?
你有什麼需要嗎?爲什麼你需要使用一個類(可能有需要,但要弄清楚推薦什麼,我們需要知道需求)... – ircmaxell 2011-01-11 15:31:15
如果你的目標是*效率*,那麼PHPs新內建的[HttpRequest ](http://www.php.net/manual/en/class.httprequest.php)是它。 – mario 2011-01-11 15:33:51