{"id":19090131,"url":"https://github.com/aportela/httprequest-wrapper","last_synced_at":"2026-02-11T04:31:31.730Z","repository":{"id":57674335,"uuid":"482985862","full_name":"aportela/httprequest-wrapper","owner":"aportela","description":"Custom php (curl) http request wrapper","archived":false,"fork":false,"pushed_at":"2025-11-29T23:24:15.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-02T04:22:57.140Z","etag":null,"topics":["composer-package","curl","http","http-client","php","php8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aportela.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-18T20:22:16.000Z","updated_at":"2025-11-29T23:23:35.000Z","dependencies_parsed_at":"2022-08-29T15:42:03.790Z","dependency_job_id":"dd4652e7-6b3a-4e37-8dd3-573d3947e646","html_url":"https://github.com/aportela/httprequest-wrapper","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"f16c187257b543c0e6c22b85daa527b16d57c783"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/aportela/httprequest-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aportela%2Fhttprequest-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aportela%2Fhttprequest-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aportela%2Fhttprequest-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aportela%2Fhttprequest-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aportela","download_url":"https://codeload.github.com/aportela/httprequest-wrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aportela%2Fhttprequest-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29327091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["composer-package","curl","http","http-client","php","php8"],"created_at":"2024-11-09T03:02:03.001Z","updated_at":"2026-02-11T04:31:31.725Z","avatar_url":"https://github.com/aportela.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httprequest-wrapper\n\nThis is a simple library to wrap \u0026 manage native PHP HTTP requests (there are plenty of serious alternatives like [Guzzle](http://docs.guzzlephp.org/), this is my tiny approach to be used in some of my personal projects, should not be taken too seriously).\n\n## Requirements\n\n- mininum php version 8.4\n- curl extension must be enabled\n\n## Limitations\n\nAt this time only GET/HEAD methods are supported.\n\n## Install (composer) dependencies:\n\n```Shell\ncomposer require aportela/httprequest-wrapper\n```\n\n## Code example:\n\n```php\n\u003c?php\n\n    require \"vendor/autoload.php\";\n\n    $logger = new \\Psr\\Log\\NullLogger(\"\");\n\n    // it requires curl extension, otherwise an \\aportela\\HTTPRequestWrapper\\Exception\\CurlMissingException is thrown\n    $http = new \\aportela\\HTTPRequestWrapper\\HTTPRequest($logger, \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1\");\n\n    try {\n        $response = $http-\u003eGET(\"https://packagist.org/packages/aportela/httprequest-wrapper\");\n        if ($response-\u003ecode == 200) {\n            echo $response-\u003ebody . PHP_EOL;\n        } else {\n            echo \"Error getting remote url, http response code: {$response-\u003ecode}\" . PHP_EOL;\n        }\n    } catch (\\aportela\\HTTPRequestWrapper\\Exception\\CurlExecException $e) {\n        // this exception is thrown if the curl execution fails and the remote server does not respond (ex: cannot open the connection, the connection has been reset, ...)\n        echo \"Error executing curl: \" . $e-\u003egetMessage();\n    }\n```\n\n## Response object struct:\n\n    code: HTTP response code (int)\n    contentType: response content type (string)\n    headers: response headers (array)\n    body: response body contents (null|string)\n\n![PHP Composer](https://github.com/aportela/httprequest-wrapper/actions/workflows/php.yml/badge.svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faportela%2Fhttprequest-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faportela%2Fhttprequest-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faportela%2Fhttprequest-wrapper/lists"}