[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8538":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":16,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":19,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":42,"readmeContent":43,"aiSummary":44,"trendingCount":14,"starSnapshotCount":14,"syncStatus":45,"lastSyncTime":46,"discoverSource":47},8538,"php-curl-class","php-curl-class\u002Fphp-curl-class","PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs","https:\u002F\u002Fwww.phpcurlclass.com\u002F",null,"PHP",3300,809,155,0,1,3,30.73,"The Unlicense",false,"master",[22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"api","api-client","class","client","curl","framework","http","http-client","http-proxy","json","php","php-curl","php-curl-library","proxy","requests","restful","web-scraper","web-scraping","web-service","xml","2026-06-12 02:01:55","# PHP Curl Class: HTTP requests made easy\n\n[![](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Fphp-curl-class\u002Fphp-curl-class.svg?style=for-the-badge&sort=semver)](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Freleases\u002F)\n[![](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fphp-curl-class\u002Fphp-curl-class.svg?style=for-the-badge)](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Fblob\u002Fmaster\u002FLICENSE)\n[![](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fphp-curl-class\u002Fphp-curl-class\u002Fci.yml?style=for-the-badge&label=build&branch=master)](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Factions\u002Fworkflows\u002Fci.yml)\n[![](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fphp-curl-class\u002Fphp-curl-class\u002Frelease.yml?style=for-the-badge&label=release&branch=master)](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Freleases\u002F)\n[![](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fphp-curl-class\u002Fphp-curl-class\u002Fdependabot\u002Fdependabot-updates?style=for-the-badge&label=Dependabot&branch=master)](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Factions\u002Fworkflows\u002Fdependabot\u002Fdependabot-updates)\n[![](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdt\u002Fphp-curl-class\u002Fphp-curl-class.svg?style=for-the-badge)](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Freleases\u002F)\n\nPHP Curl Class makes it easy to send HTTP requests and integrate with web APIs.\n\n![PHP Curl Class screencast](www\u002Fimg\u002Fscreencast.gif)\n\n---\n\n- [⚙️ Installation](#%EF%B8%8F-installation)\n- [📋 Requirements](#-requirements)\n- [🚀 Quick Start and Examples](#-quick-start-and-examples)\n- [📖 Available Methods](#-available-methods)\n- [🔒 Security](#-security)\n- [🛠️ Troubleshooting](#%EF%B8%8F-troubleshooting)\n- [🧪 Testing](#-testing)\n- [🤝 Contributing](#-contributing)\n\n---\n\n### ⚙️ Installation\n\nTo install PHP Curl Class, run the following command:\n\n    composer require php-curl-class\u002Fphp-curl-class\n\nTo install the latest commit version:\n\n    composer require php-curl-class\u002Fphp-curl-class @dev\n\nInstallation instructions to use the `composer` command can be found on https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fcomposer.\n\n### 📋 Requirements\n\nPHP Curl Class works with PHP versions 8.5, 8.4, 8.3, 8.2, 8.1, and 8.0.\n\n### 🚀 Quick Start and Examples\n\nMore examples are available under [\u002Fexamples](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Ftree\u002Fmaster\u002Fexamples).\n\n```php\nrequire __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\nuse Curl\\Curl;\n\n$curl = new Curl();\n$curl->get('https:\u002F\u002Fwww.example.com\u002F');\n\nif ($curl->error) {\n    echo 'Error: ' . $curl->errorMessage . \"\\n\";\n    $curl->diagnose();\n} else {\n    echo 'Response:' . \"\\n\";\n    var_dump($curl->response);\n}\n```\n\n```php\n\u002F\u002F https:\u002F\u002Fwww.example.com\u002Fsearch?q=keyword\n$curl = new Curl();\n$curl->get('https:\u002F\u002Fwww.example.com\u002Fsearch', [\n    'q' => 'keyword',\n]);\n```\n\n```php\n$curl = new Curl();\n$curl->post('https:\u002F\u002Fwww.example.com\u002Flogin\u002F', [\n    'username' => 'myusername',\n    'password' => 'mypassword',\n]);\n```\n\n```php\n$curl = new Curl();\n$curl->setBasicAuthentication('username', 'password');\n$curl->setUserAgent('MyUserAgent\u002F0.0.1 (+https:\u002F\u002Fwww.example.com\u002Fbot.html)');\n$curl->setReferrer('https:\u002F\u002Fwww.example.com\u002Furl?url=https%3A%2F%2Fwww.example.com%2F');\n$curl->setHeader('X-Requested-With', 'XMLHttpRequest');\n$curl->setCookie('key', 'value');\n$curl->get('https:\u002F\u002Fwww.example.com\u002F');\n\nif ($curl->error) {\n    echo 'Error: ' . $curl->errorMessage . \"\\n\";\n} else {\n    echo 'Response:' . \"\\n\";\n    var_dump($curl->response);\n}\n\nvar_dump($curl->requestHeaders);\nvar_dump($curl->responseHeaders);\n```\n\n```php\n$curl = new Curl();\n$curl->setFollowLocation();\n$curl->get('https:\u002F\u002Fshortn.example.com\u002FbHbVsP');\n```\n\n```php\n$curl = new Curl();\n$curl->put('https:\u002F\u002Fapi.example.com\u002Fuser\u002F', [\n    'first_name' => 'Zach',\n    'last_name' => 'Borboa',\n]);\n```\n\n```php\n$curl = new Curl();\n$curl->patch('https:\u002F\u002Fapi.example.com\u002Fprofile\u002F', [\n    'image' => '@path\u002Fto\u002Ffile.jpg',\n]);\n```\n\n```php\n$curl = new Curl();\n$curl->patch('https:\u002F\u002Fapi.example.com\u002Fprofile\u002F', [\n    'image' => new CURLFile('path\u002Fto\u002Ffile.jpg'),\n]);\n```\n\n```php\n$curl = new Curl();\n$curl->delete('https:\u002F\u002Fapi.example.com\u002Fuser\u002F', [\n    'id' => '1234',\n]);\n```\n\n```php\n\u002F\u002F Enable all supported encoding types and download a file.\n$curl = new Curl();\n$curl->setOpt(CURLOPT_ENCODING , '');\n$curl->download('https:\u002F\u002Fwww.example.com\u002Ffile.bin', '\u002Ftmp\u002Fmyfile.bin');\n```\n\n```php\n\u002F\u002F Case-insensitive access to headers.\n$curl = new Curl();\n$curl->download('https:\u002F\u002Fwww.example.com\u002Fimage.png', '\u002Ftmp\u002Fmyimage.png');\necho $curl->responseHeaders['Content-Type'] . \"\\n\"; \u002F\u002F image\u002Fpng\necho $curl->responseHeaders['CoNTeNT-TyPE'] . \"\\n\"; \u002F\u002F image\u002Fpng\n```\n\n```php\n\u002F\u002F Manual clean up.\n$curl->close();\n```\n\n```php\n\u002F\u002F Example access to curl object.\ncurl_set_opt($curl->curl, CURLOPT_USERAGENT, 'Mozilla\u002F4.0 (compatible; MSIE 7.0; Windows NT 5.1');\n```\n\n```php\nrequire __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\nuse Curl\\MultiCurl;\n\n\u002F\u002F Requests in parallel with callback functions.\n$multi_curl = new MultiCurl();\n\n$multi_curl->success(function($instance) {\n    echo 'call to \"' . $instance->url . '\" was successful.' . \"\\n\";\n    echo 'response:' . \"\\n\";\n    var_dump($instance->response);\n});\n$multi_curl->error(function($instance) {\n    echo 'call to \"' . $instance->url . '\" was unsuccessful.' . \"\\n\";\n    echo 'error code: ' . $instance->errorCode . \"\\n\";\n    echo 'error message: ' . $instance->errorMessage . \"\\n\";\n});\n$multi_curl->complete(function($instance) {\n    echo 'call completed' . \"\\n\";\n});\n\n$multi_curl->addGet('https:\u002F\u002Fwww.google.com\u002Fsearch', [\n    'q' => 'hello world',\n]);\n$multi_curl->addGet('https:\u002F\u002Fduckduckgo.com\u002F', [\n    'q' => 'hello world',\n]);\n$multi_curl->addGet('https:\u002F\u002Fwww.bing.com\u002Fsearch', [\n    'q' => 'hello world',\n]);\n\n$multi_curl->start(); \u002F\u002F Blocks until all items in the queue have been processed.\n```\n\nMore examples are available under [\u002Fexamples](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Ftree\u002Fmaster\u002Fexamples).\n\n### 📖 Available Methods\n```php\nCurl::__construct($base_url = null, $options = [])\nCurl::__destruct()\nCurl::__get($name)\nCurl::__isset($name)\nCurl::afterSend($callback)\nCurl::attemptRetry()\nCurl::beforeSend($callback)\nCurl::buildPostData($data)\nCurl::call()\nCurl::close()\nCurl::complete($callback)\nCurl::delete($url, $query_parameters = [], $data = [])\nCurl::diagnose($return = false)\nCurl::disableTimeout()\nCurl::displayCurlOptionValue($option, $value = null)\nCurl::download($url, $mixed_filename)\nCurl::error($callback)\nCurl::exec($ch = null)\nCurl::execDone()\nCurl::fastDownload($url, $filename, $connections = 4)\nCurl::get($url, $data = [])\nCurl::getAttempts()\nCurl::getBeforeSendCallback()\nCurl::getCompleteCallback()\nCurl::getCookie($key)\nCurl::getCurl()\nCurl::getCurlErrorCode()\nCurl::getCurlErrorMessage()\nCurl::getDownloadCompleteCallback()\nCurl::getDownloadFileName()\nCurl::getErrorCallback()\nCurl::getErrorCode()\nCurl::getErrorMessage()\nCurl::getFileHandle()\nCurl::getHttpErrorMessage()\nCurl::getHttpStatusCode()\nCurl::getId()\nCurl::getInfo($opt = null)\nCurl::getJsonDecoder()\nCurl::getOpt($option)\nCurl::getOptions()\nCurl::getRawResponse()\nCurl::getRawResponseHeaders()\nCurl::getRemainingRetries()\nCurl::getRequestHeaders()\nCurl::getResponse()\nCurl::getResponseCookie($key)\nCurl::getResponseCookies()\nCurl::getResponseHeaders()\nCurl::getRetries()\nCurl::getRetryDecider()\nCurl::getSuccessCallback()\nCurl::getUrl()\nCurl::getUserSetOptions()\nCurl::getXmlDecoder()\nCurl::head($url, $data = [])\nCurl::isChildOfMultiCurl()\nCurl::isCurlError()\nCurl::isError()\nCurl::isHttpError()\nCurl::options($url, $data = [])\nCurl::patch($url, $data = [])\nCurl::post($url, $data = '', $follow_303_with_post = false)\nCurl::progress($callback)\nCurl::put($url, $data = [])\nCurl::removeHeader($key)\nCurl::reset()\nCurl::search($url, $data = [])\nCurl::setAutoReferer($auto_referer = true)\nCurl::setAutoReferrer($auto_referrer = true)\nCurl::setBasicAuthentication($username, $password = '')\nCurl::setConnectTimeout($seconds)\nCurl::setCookie($key, $value)\nCurl::setCookieFile($cookie_file)\nCurl::setCookieJar($cookie_jar)\nCurl::setCookieString($string)\nCurl::setCookies($cookies)\nCurl::setDefaultDecoder($mixed = 'json')\nCurl::setDefaultHeaderOut()\nCurl::setDefaultJsonDecoder()\nCurl::setDefaultTimeout()\nCurl::setDefaultUserAgent()\nCurl::setDefaultXmlDecoder()\nCurl::setDelete($url, $query_parameters = [], $data = [])\nCurl::setDigestAuthentication($username, $password = '')\nCurl::setFile($file)\nCurl::setFollowLocation($follow_location = true)\nCurl::setForbidReuse($forbid_reuse = true)\nCurl::setGet($url, $data = [])\nCurl::setHead($url, $data = [])\nCurl::setHeader($key, $value)\nCurl::setHeaders($headers)\nCurl::setInterface($interface)\nCurl::setJsonDecoder($mixed)\nCurl::setMaxFilesize($bytes)\nCurl::setMaximumRedirects($maximum_redirects)\nCurl::setOpt($option, $value)\nCurl::setOptions($url, $data = [])\nCurl::setOpts($options)\nCurl::setPatch($url, $data = [])\nCurl::setPort($port)\nCurl::setPost($url, $data = '', $follow_303_with_post = false)\nCurl::setProtocols($protocols)\nCurl::setProxy($proxy, $port = null, $username = null, $password = null)\nCurl::setProxyAuth($auth)\nCurl::setProxyTunnel($tunnel = true)\nCurl::setProxyType($type)\nCurl::setPut($url, $data = [])\nCurl::setRange($range)\nCurl::setRedirectProtocols($redirect_protocols)\nCurl::setReferer($referer)\nCurl::setReferrer($referrer)\nCurl::setRetry($mixed)\nCurl::setSearch($url, $data = [])\nCurl::setStop($callback = null)\nCurl::setTimeout($seconds)\nCurl::setUrl($url, $mixed_data = '')\nCurl::setUserAgent($user_agent)\nCurl::setXmlDecoder($mixed)\nCurl::stop()\nCurl::success($callback)\nCurl::unsetHeader($key)\nCurl::unsetProxy()\nCurl::verbose($on = true, $output = 'STDERR')\nMultiCurl::__construct($base_url = null)\nMultiCurl::__destruct()\nMultiCurl::addCurl(Curl $curl)\nMultiCurl::addDelete($url, $query_parameters = [], $data = [])\nMultiCurl::addDownload($url, $mixed_filename)\nMultiCurl::addGet($url, $data = [])\nMultiCurl::addHead($url, $data = [])\nMultiCurl::addOptions($url, $data = [])\nMultiCurl::addPatch($url, $data = [])\nMultiCurl::addPost($url, $data = '', $follow_303_with_post = false)\nMultiCurl::addPut($url, $data = [])\nMultiCurl::addSearch($url, $data = [])\nMultiCurl::afterSend($callback)\nMultiCurl::beforeSend($callback)\nMultiCurl::close()\nMultiCurl::complete($callback)\nMultiCurl::disableTimeout()\nMultiCurl::error($callback)\nMultiCurl::getActiveCurls()\nMultiCurl::getOpt($option)\nMultiCurl::removeHeader($key)\nMultiCurl::setAutoReferer($auto_referer = true)\nMultiCurl::setAutoReferrer($auto_referrer = true)\nMultiCurl::setBasicAuthentication($username, $password = '')\nMultiCurl::setConcurrency($concurrency)\nMultiCurl::setConnectTimeout($seconds)\nMultiCurl::setCookie($key, $value)\nMultiCurl::setCookieFile($cookie_file)\nMultiCurl::setCookieJar($cookie_jar)\nMultiCurl::setCookieString($string)\nMultiCurl::setCookies($cookies)\nMultiCurl::setDigestAuthentication($username, $password = '')\nMultiCurl::setFile($file)\nMultiCurl::setFollowLocation($follow_location = true)\nMultiCurl::setForbidReuse($forbid_reuse = true)\nMultiCurl::setHeader($key, $value)\nMultiCurl::setHeaders($headers)\nMultiCurl::setInterface($interface)\nMultiCurl::setJsonDecoder($mixed)\nMultiCurl::setMaximumRedirects($maximum_redirects)\nMultiCurl::setOpt($option, $value)\nMultiCurl::setOpts($options)\nMultiCurl::setPort($port)\nMultiCurl::setProxies($proxies)\nMultiCurl::setProxy($proxy, $port = null, $username = null, $password = null)\nMultiCurl::setProxyAuth($auth)\nMultiCurl::setProxyTunnel($tunnel = true)\nMultiCurl::setProxyType($type)\nMultiCurl::setRange($range)\nMultiCurl::setRateLimit($rate_limit)\nMultiCurl::setReferer($referer)\nMultiCurl::setReferrer($referrer)\nMultiCurl::setRequestTimeAccuracy()\nMultiCurl::setRetry($mixed)\nMultiCurl::setTimeout($seconds)\nMultiCurl::setUrl($url, $mixed_data = '')\nMultiCurl::setUserAgent($user_agent)\nMultiCurl::setXmlDecoder($mixed)\nMultiCurl::start()\nMultiCurl::stop()\nMultiCurl::success($callback)\nMultiCurl::unsetHeader($key)\nMultiCurl::unsetProxy()\nMultiCurl::verbose($on = true, $output = 'STDERR')\n```\n\n### 🔒 Security\n\nSee [SECURITY](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Fblob\u002Fmaster\u002FSECURITY.md) for security considerations.\n\n### 🛠️ Troubleshooting\n\nSee [TROUBLESHOOTING](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Fblob\u002Fmaster\u002FTROUBLESHOOTING.md) for help troubleshooting.\n\n### 🧪 Testing\n\nSee [TESTING](https:\u002F\u002Fgithub.com\u002Fphp-curl-class\u002Fphp-curl-class\u002Fblob\u002Fmaster\u002FTESTING.md) for testing information.\n\n### 🤝 Contributing\n\n1. Check for open issues or open a new issue to start a discussion around a bug or feature.\n1. Fork the repository on GitHub to start making your changes.\n1. Write one or more tests for the new feature or that expose the bug.\n1. Make code changes to implement the feature or fix the bug.\n1. Send a pull request to get your changes merged and published.\n","PHP Curl Class 是一个简化HTTP请求发送和Web API集成的PHP库。它通过封装cURL功能，提供了易于使用的API来执行GET、POST等HTTP请求，并支持JSON\u002FXML格式的数据处理。此外，该库还具备处理HTTP代理、设置自定义HTTP头以及进行基本认证等功能。适用于需要与外部服务进行交互的各种PHP项目中，如数据抓取、API客户端开发等场景。其简洁的接口设计使得开发者能够快速上手并高效地完成网络通信相关的任务。",2,"2026-06-11 03:18:32","top_language"]