{"id":36993003,"url":"https://github.com/demartis/jttp-php","last_synced_at":"2026-01-13T23:45:10.752Z","repository":{"id":54743219,"uuid":"294628591","full_name":"demartis/jttp-php","owner":"demartis","description":"A simple PHP implementation of the JTTP specification","archived":false,"fork":false,"pushed_at":"2021-02-01T09:25:50.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T14:50:11.415Z","etag":null,"topics":["json","jttp","php","response","rest-api","standard"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/demartis.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}},"created_at":"2020-09-11T07:44:18.000Z","updated_at":"2020-09-15T16:04:31.000Z","dependencies_parsed_at":"2022-08-14T01:21:01.842Z","dependency_job_id":null,"html_url":"https://github.com/demartis/jttp-php","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/demartis/jttp-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demartis%2Fjttp-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demartis%2Fjttp-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demartis%2Fjttp-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demartis%2Fjttp-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/demartis","download_url":"https://codeload.github.com/demartis/jttp-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demartis%2Fjttp-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["json","jttp","php","response","rest-api","standard"],"created_at":"2026-01-13T23:45:10.689Z","updated_at":"2026-01-13T23:45:10.747Z","avatar_url":"https://github.com/demartis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JTTP\n\nA simple PHP implementation of the [JTTP specification](https://github.com/demartis/jttp).\n\n- [GitHub project](https://github.com/demartis/jttp-php)\n- [Composer package](https://packagist.org/packages/demartis/jttp)\n\n## Usage\n\n```php\nuse Jttp\\JttpResponse;\n\n$data = ['field'=\u003e'dummy data'];\n$success = JttpResponse::ok($data);\n\n$success = JttpResponse::success(200, \"OK\", $data);\n\n$error = JttpResponse::error(401, null, ['Not cool.']);\n$errorWithMessage = JttpResponse::error(401, 'not authorized', ['Not cool.']);\n\n\n```\n\nCreate Jttp object from JttpResponse:\n\n```php\nuse Jttp\\Jttp;\nuse Jttp\\JttpResponse;\n$data = ['field'=\u003e'dummy data'];\n$responseOkWithData = JttpResponse::ok($data);\n$jttp = Jttp::createFromResponse($responseOkWithData);\n```\n\nCreate Jttp object from simple response array:\n\n```php\nuse Jttp\\Jttp;\nuse Jttp\\JttpResponse;\n$res =  array(\n    \"status\" =\u003e \"success\",\n    \"code\" =\u003e 200,\n    \"message\"=\u003e \"OK\",\n    \"data\"=\u003e ['field'=\u003e'dummy data']\n);\n\n$jttp = Jttp::createFromJttpArray($res);\n\n// get status\n$jttp-\u003egetStatus(); // 'success'\n$jttp-\u003eisSuccess(); // true\n$jttp-\u003egetData(); // ['field'=\u003e'dummy data']\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemartis%2Fjttp-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemartis%2Fjttp-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemartis%2Fjttp-php/lists"}