{"id":15558427,"url":"https://github.com/enishant/magiccurl","last_synced_at":"2025-04-09T17:03:58.401Z","repository":{"id":62550536,"uuid":"499553091","full_name":"enishant/magiccurl","owner":"enishant","description":"MagicCurl PHP Library","archived":false,"fork":false,"pushed_at":"2023-08-23T09:40:44.000Z","size":24,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-07T08:10:21.766Z","etag":null,"topics":["curl","get","get-request","hacktoberfest","hacktoberfest2022","json","magiccurl","php","php-library","post","post-request","request","requests","response","responses"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/enishant/magiccurl","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/enishant.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":"2022-06-03T15:02:37.000Z","updated_at":"2023-11-10T17:12:44.000Z","dependencies_parsed_at":"2023-02-10T17:15:54.948Z","dependency_job_id":null,"html_url":"https://github.com/enishant/magiccurl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enishant%2Fmagiccurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enishant%2Fmagiccurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enishant%2Fmagiccurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enishant%2Fmagiccurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enishant","download_url":"https://codeload.github.com/enishant/magiccurl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229421511,"owners_count":18070351,"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","get","get-request","hacktoberfest","hacktoberfest2022","json","magiccurl","php","php-library","post","post-request","request","requests","response","responses"],"created_at":"2024-10-02T15:34:05.709Z","updated_at":"2024-12-12T17:17:53.220Z","avatar_url":"https://github.com/enishant.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MagicCurl PHP Library\n\n[![Stable](https://poser.pugx.org/enishant/magiccurl/v)](https://packagist.org/packages/enishant/magiccurl)\n[![PHP Version Require](http://poser.pugx.org/enishant/magiccurl/require/php)](https://packagist.org/packages/enishant/magiccurl)\n[![License](https://poser.pugx.org/enishant/magiccurl/license)](https://packagist.org/packages/enishant/magiccurl)\n[![Downloads](https://poser.pugx.org/enishant/magiccurl/downloads)](https://packagist.org/packages/enishant/magiccurl)\n\n### Prerequisites\n- A minimum of PHP 7.x upto 8.1\n- PHP cURL extension\n\n## Installation\n\n-   If your project using composer, run the below command\n\n```php\ncomposer require enishant/magiccurl:1.0\n```\n\n- If you are not using composer, download the latest release from [the releases section](https://github.com/enishant/magiccurl/releases).\n    **You should download the `magiccurl.zip` file**.\n    After that, include `MagicCurl.php` in your application and you can use the MagicCurl methods by creating it's instance.\n\nNote: This PHP library follows the following practices:\n\n- Namespaced under `Enishant\\MagicCurl`\n- Options are passed as an array instead of multiple arguments wherever possible\n- All requests and responses are communicated using PHP CURL extension\n\n## Basic Usage\n\nInstantiate the MagicCurl php instance with/without providing an options.\n\n```php\nuse Enishant\\MagicCurl\\MagicCurl;\n\n$client = new MagicCurl;\n```\n### Options\n- `create_log` - Creates log for user agent, header, request and response.\n- `log_path` - Provide log file path.\n- `debug` - Display all php errors.\n- `user_agent` - Custom [User Agent](https://en.wikipedia.org/wiki/User_agent) name.\n\n#### Create log file, update onwership \u0026 permissions\n`sudo touch /path/to/magiccurl.log`\n\n`sudo chown www-data:www-data /path/to/magiccurl.log`\n\n`sudo chmod 644 /path/to/magiccurl.log`\n\n```php\nuse Enishant\\MagicCurl\\MagicCurl;\n\n$options = [\n\t'create_log' =\u003e true,\n\t'log_path'   =\u003e '/path/to/magiccurl.log',\n\t'debug'      =\u003e true,\n\t'user_agent' =\u003e 'MagicCurl/1.0'\n];\n\n$client = new MagicCurl( $options );\n```\n\nThe resources can be accessed via the `$client` object. All the methods invocations follows the following pattern\n\n```php\n    // $client-\u003efunction() to access the methods\n    \n    //Example - Request with GET method\n    $client-\u003eget($url);\n    $client-\u003eget($url, $payload, $headers);\n\n    //Example - Request with POST method\n    $headers = [\n      'Accept: application/json',\n      'Content-Type: application/json',\n    ];\n    $payload = ['data'=\u003e'in array'];\n    $client-\u003epost($url, $payload, $headers);\n```\n## Contributing\nAll contributions for enhancement and fixes will be accepted through pull request, you can also contribute by reporting issues, [Click here](https://github.com/enishant/magiccurl/issues/new) to report an issue.\n\n## License\nThe MagicCurl PHP Library is released under the MIT License. See [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenishant%2Fmagiccurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenishant%2Fmagiccurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenishant%2Fmagiccurl/lists"}