{"id":42712697,"url":"https://github.com/denismitr/net-call","last_synced_at":"2026-01-29T15:12:51.972Z","repository":{"id":56965644,"uuid":"118276646","full_name":"denismitr/net-call","owner":"denismitr","description":"Easy to use and mockable HTTP client","archived":false,"fork":false,"pushed_at":"2018-01-20T20:13:17.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T20:07:34.296Z","etag":null,"topics":["http","http-client","http-request"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denismitr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-20T20:07:08.000Z","updated_at":"2024-04-23T14:25:46.000Z","dependencies_parsed_at":"2022-08-21T09:20:38.331Z","dependency_job_id":null,"html_url":"https://github.com/denismitr/net-call","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/denismitr/net-call","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismitr%2Fnet-call","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismitr%2Fnet-call/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismitr%2Fnet-call/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismitr%2Fnet-call/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denismitr","download_url":"https://codeload.github.com/denismitr/net-call/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismitr%2Fnet-call/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28880017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["http","http-client","http-request"],"created_at":"2026-01-29T15:12:51.248Z","updated_at":"2026-01-29T15:12:51.966Z","avatar_url":"https://github.com/denismitr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetCall\n\nNetCall is a convenient and easy to use HTTP client. \nIt is a wrapper around Guzzle, made for most common use cases.\nAnd is designed to make development and testing easier and more pleasant.\n\n### Author\nDenis Mitrofanov\n\n### Installation\n```bash\ncomposer require denismitr/net-call\n```\n\n### Usage\n```php\n$response = NetCall::new()-\u003eget('http://www.google.com?foo=bar');\n\n// NetCallResponseInterface methods\n$response-\u003ebody(); // : string\n$response-\u003ejson(); // : array\n$response-\u003eheader('some-key');\n$response-\u003eheaders(); // : array\n$response-\u003estatus(); // : int\n$response-\u003eisSuccess(); // : bool\n$response-\u003eisOk(); // : bool\n$response-\u003eisRedirect(); // : bool\n$response-\u003eisServerError(); // : bool\n```\n```php\n// request params will be json encoded by default\n$response = NetCall::new()-\u003epost('http://test.com/post', [\n    'foo' =\u003e 'bar',\n    'baz' =\u003e 'qux',\n]);\n\n$response-\u003ejson();\n// array with json response data\n```\n\nFrom Params\n```php\n$response = NetCall::new()-\u003easFormData()-\u003epost('http://myurl.com/post', [\n    'foo' =\u003e 'bar',\n    'baz' =\u003e 'qux',\n]);\n```\n\nMultipart\n```php\n$response = NetCall::new()-\u003easMultipart()-\u003epost('http://myurl.com/multi-part', [\n    [\n        'name' =\u003e 'foo',\n        'contents' =\u003e 'bar'\n    ],\n    [\n        'name' =\u003e 'baz',\n        'contents' =\u003e 'qux',\n    ],\n    [\n        'name' =\u003e 'test-file',\n        'contents' =\u003e 'test contents',\n        'filename' =\u003e 'test-file.txt',\n    ],\n]);\n```\n\nWith Headers\n```php\n$response = NetCall::new()\n    -\u003ewithHeaders(['Custom' =\u003e 'Header'])\n    -\u003eget('http://myurl.com/get');\n```\n\nSet Accept header\n```php\n$response = NetCall::new()\n    -\u003eaccept('application/json')\n    -\u003epost('http://myurl.com/post');\n```\n\nPatch requests are supported\n```php\n$response = NetCall::new()-\u003epatch('http://myurl.com/patch', [\n    'foo' =\u003e 'bar',\n    'baz' =\u003e 'qux',\n]);\n```\n\n### Exceptions\nExceptions are not thrown on 4xx and 5xx: use response status method instead.\n\n### Redirects\nRedirects are followed by default\n\nTo disable that:\n```php\n$response = NetCall::new()-\u003enoRedirects()-\u003eget('http://myurl.com/get');\n\n$response-\u003estatus(); // 302\n$response-\u003eheader('Location'); // http://myurl.com/redirected\n```\n\n### Auth\n\nBasic auth\n```php\n$response = NetCall::new()\n    -\u003ewithBasicAuth('username', 'password')\n    -\u003eget('http://myurl.com/basic-auth');\n```\n\nDigest auth\n```php\n$response = NetCall::new()\n    -\u003ewithDigestAuth('username', 'password')\n    -\u003eget('http://myurl.com/digest-auth');\n```\n\n### Timeout\n\nSet timeout\n```php\nNetCall::new()-\u003etimeout(1)-\u003eget('http://myurl.com/timeout');\n\n// If more then a second passes\n// \\Denismitr\\NetCall\\Exceptions\\NetCallException is thrown\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismitr%2Fnet-call","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenismitr%2Fnet-call","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismitr%2Fnet-call/lists"}