{"id":18458334,"url":"https://github.com/crazyfactory/php-curl","last_synced_at":"2025-04-23T12:24:30.368Z","repository":{"id":74458838,"uuid":"106495007","full_name":"crazyfactory/php-curl","owner":"crazyfactory","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-18T03:19:36.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T15:31:16.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazyfactory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-11T02:24:51.000Z","updated_at":"2018-07-18T03:19:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"80593a3a-3e97-4abc-8a7a-4e18bba3baf4","html_url":"https://github.com/crazyfactory/php-curl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Fphp-curl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Fphp-curl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Fphp-curl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Fphp-curl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazyfactory","download_url":"https://codeload.github.com/crazyfactory/php-curl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250431936,"owners_count":21429588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T08:17:53.363Z","updated_at":"2025-04-23T12:24:30.362Z","avatar_url":"https://github.com/crazyfactory.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Curl\n\nThis wrapper around php's curl functions. PHP 5.3 compatible for sad reasons.\n\n## Installation\n\nVia composer \n\n`composer require crazyfactory/curl`\n\n## Usage\n\n### Simple\nLoad a page\n```php\n$responseBody = (new Curl)-\u003eget('http://www.example.org');\n```\n\n### Sending fields\nPass in GET parameters as an array\n```php\n$responseBody = (new Curl)-\u003eget($url, [\n    'foo' =\u003e 'bar'\n]);\n```\n\nSame for POST\n```php\n$responseBody = (new Curl)-\u003epost($url, [\n    'foo' =\u003e 'bar'\n]);\n```\n\nFor other methods, use `call()` directly.\n\n### Curl options and info\n`call()` accept an array of CURLOPT-constants and merges these with the defaults from `getDefaultOptions()`. `post()` and `get()` accept this array as 3rd parameter as well.\n\nThe last argument for all of these function is a reference to the returned curl-info for fancier things.\n\n### Exceptions\n`call()` will throw `CrazyFactory/Curl/Exception` when any error happens. It will also throw an Exception on 400+ status codes.\n\n```php\ntry {\n    (new Curl)-\u003eget('http://httpbin.org/status/404');\n}\ncatch (CrazyFactory/Curl/Exception $e) {\n    echo \"Whoops we had a {$e-\u003egetHttpCode()}!\"; \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyfactory%2Fphp-curl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazyfactory%2Fphp-curl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyfactory%2Fphp-curl/lists"}