{"id":21056015,"url":"https://github.com/xp-framework/http","last_synced_at":"2025-05-15T23:32:51.905Z","repository":{"id":11788036,"uuid":"14329900","full_name":"xp-framework/http","owner":"xp-framework","description":"HTTP protocol support for the XP Framework","archived":false,"fork":false,"pushed_at":"2024-03-24T11:58:12.000Z","size":3533,"stargazers_count":2,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-03T14:42:01.072Z","etag":null,"topics":["http-client","php","ssl-connection","xp-framework"],"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/xp-framework.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2013-11-12T11:06:57.000Z","updated_at":"2023-06-25T09:43:25.000Z","dependencies_parsed_at":"2022-09-23T02:01:05.461Z","dependency_job_id":"53a680da-f8f2-4cac-b439-3a93bd787797","html_url":"https://github.com/xp-framework/http","commit_stats":{"total_commits":18027,"total_committers":40,"mean_commits":450.675,"dds":0.3570754978643146,"last_synced_commit":"6d43ac5405408bcf73acf8e0bd4f318c3ca848e9"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-framework","download_url":"https://codeload.github.com/xp-framework/http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442407,"owners_count":22071864,"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":["http-client","php","ssl-connection","xp-framework"],"created_at":"2024-11-19T16:48:19.585Z","updated_at":"2025-05-15T23:32:50.463Z","avatar_url":"https://github.com/xp-framework.png","language":"PHP","readme":"HTTP protocol support for the XP Framework\n========================================================================\n\n[![Build status on GitHub](https://github.com/xp-framework/http/workflows/Tests/badge.svg)](https://github.com/xp-framework/http/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-framework/http/version.png)](https://packagist.org/packages/xp-framework/http)\n\nImplements HTTP (HyperText Transfer Protocol) and provides a client to interact with HTTP servers. The `HttpConnection` is the entry point class.\n\nMethods\n-------\nDifferent request methods are handled by `HttpConnection` class methods as follows:\n\n* GET - via `get()`\n* POST - via `post()`\n* HEAD - via `head()`\n* PUT - via `put()`\n* PATCH - via `patch()`\n* DELETE - via `delete()`\n* OPTIONS - via `options()`\n* TRACE - via `trace()`\n\nOther methods (e.g. `MKCOL` from WebDAV) are supported via `request()`.\n\nHeaders\n-------\nThe following code will show the response headers for a HEAD request:\n\n```php\nuse peer\\http\\HttpConnection;\n\n$c= new HttpConnection('http://xp-framework.net/');\nConsole::writeLine($c-\u003ehead());\n```\n\nGetting data\n-----------\n\n```php\nwith ($c= new HttpConnection('http://xp-framework.net/')); {\n  $response= $c-\u003eget();\n  Console::writeLine('Response: ', $response);\n  \n  $in= $response-\u003ein();\n  while ($in-\u003eavailable()) {\n    $bytes= $in-\u003eread();\n  }\n}\n```\n\nSSL support\n-----------\nThis API also supports SSL connections - based on the scheme given to `HttpConnection`'s constructor the `HttpRequestFactory` class will create an SSL connection. This is transparent from the outside, the rest of the calls are the same!\n\nExample:\n\n```php\n$c= new HttpConnection('https://example.com/');\n```\n\nNote: SSL connections depend on either the PHP extension `curl` or `openssl`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-framework%2Fhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fhttp/lists"}