{"id":19762646,"url":"https://github.com/opensooq/webservice","last_synced_at":"2026-05-08T03:05:02.062Z","repository":{"id":88188793,"uuid":"71787853","full_name":"OpenSooq/WebService","owner":"OpenSooq","description":"Building a RESTful Web Service :: Learn how to create a RESTful web service with Yii2","archived":false,"fork":false,"pushed_at":"2017-06-16T18:32:16.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"devlop","last_synced_at":"2025-01-10T23:42:29.752Z","etag":null,"topics":["curl","webservice","yii2"],"latest_commit_sha":null,"homepage":"","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/OpenSooq.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":"2016-10-24T12:44:29.000Z","updated_at":"2019-05-11T09:30:49.000Z","dependencies_parsed_at":"2023-03-17T17:01:28.519Z","dependency_job_id":null,"html_url":"https://github.com/OpenSooq/WebService","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSooq%2FWebService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSooq%2FWebService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSooq%2FWebService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSooq%2FWebService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenSooq","download_url":"https://codeload.github.com/OpenSooq/WebService/tar.gz/refs/heads/devlop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241094648,"owners_count":19908675,"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":["curl","webservice","yii2"],"created_at":"2024-11-12T04:06:01.037Z","updated_at":"2026-05-08T03:05:02.027Z","avatar_url":"https://github.com/OpenSooq.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"WebService extension\n====================\n\ncurl extension for Yii2:\n\n - POST\n - GET\n - HEAD\n - PUT\n - DELETE\n\nRequirements\n------------\n- PHP 5.4+\n- Curl and php-curl installed\n\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n```bash\nphp composer.phar require --prefer-dist opensooq/webservice\n```\n\nor add\n```php\n\"opensooq/web-service\": \"*\"\n```\n\nUsage\n-----\n - GET\n\n```php\n//Create GET request\n$url = 'https://apilayer.net/api/convert';\n$getParams = ['from'=\u003e'USD','to'=\u003e'EUR','amount'=\u003e1];\n$options   = [CURLOPT_TIMEOUT=\u003e40];\n$headers   = ['Content-Type'=\u003e'application/json'];\n\n// GET\n$response   = HttpClient::get($url, $getParams, $headers,$options);\n```\n```php\nOUTPUT:\nArray\n(\n    [info] =\u003e Array\n        (\n            [code] =\u003e 200\n            [Content-Type] =\u003e application/json; Charset=UTF-8\n            [curl-error] =\u003e\n            [curl-header] =\u003e GET /api/convert?from=USD\u0026to=EUR\u0026amount=1 HTTP/1.1\n                            Host: apilayer.net\n                            User-Agent: OpenSooqClient 1.0\n                            Accept: */*\n                            Content-Type: application/json\n                            Content-Length: 2\n\n\n        )\n\n    [response] =\u003e stdClass Object\n        (\n            [success] =\u003e\n            [error] =\u003e stdClass Object\n                (\n                    [code] =\u003e 101\n                    [type] =\u003e missing_access_key\n                    [info] =\u003e You have not supplied an API Access Key. [Required format: access_key=YOUR_ACCESS_KEY]\n                )\n\n        )\n\n)\n```\n - POST\n\n```php\n// Make sure you fill\n$response = HttpClient::post($url,$postParams,$getParams, $headers, $options)\n```\n\n- General Request\n```php\n//Init webservice\n$verb = 'PUT';\n$response = HttpClient::request($verb,$url,$getParams,null, $headers, $options)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensooq%2Fwebservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensooq%2Fwebservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensooq%2Fwebservice/lists"}