{"id":21467424,"url":"https://github.com/elusivecodes/fyrecurl","last_synced_at":"2026-02-14T05:35:13.385Z","repository":{"id":62550962,"uuid":"504519690","full_name":"elusivecodes/FyreCURL","owner":"elusivecodes","description":"FyreCURL is a free, open-source cURL request library for PHP.","archived":false,"fork":false,"pushed_at":"2024-10-30T13:46:56.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-30T14:43:56.166Z","etag":null,"topics":["curl","php"],"latest_commit_sha":null,"homepage":"","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/elusivecodes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-17T12:05:18.000Z","updated_at":"2024-10-30T13:46:06.000Z","dependencies_parsed_at":"2024-06-29T07:37:44.845Z","dependency_job_id":null,"html_url":"https://github.com/elusivecodes/FyreCURL","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreCURL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreCURL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreCURL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreCURL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreCURL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226017502,"owners_count":17560523,"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","php"],"created_at":"2024-11-23T08:17:57.707Z","updated_at":"2026-02-14T05:35:13.336Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreCURL\r\n\r\n**FyreCURL** is a free, open-source cURL request library for *PHP*.\r\n\r\n\r\n## Table Of Contents\r\n- [Installation](#installation)\r\n- [Methods](#methods)\r\n- [Curl Requests](#curl-requests)\r\n- [Curl Responses](#curl-responses)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/curl\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\CURL\\Curl;\r\n```\r\n\r\n\r\n## Methods\r\n\r\n**Delete**\r\n\r\nPerform a DELETE request.\r\n\r\n- `$url` is a string representing the URL.\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$response = Curl::delete($url, $options);\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n**Get**\r\n\r\nPerform a GET request.\r\n\r\n- `$url` is a string representing the URL.\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `data` is an array containing additional data to send with the request, and will default to *null*.\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$response = Curl::get($url, $options);\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n**Head**\r\n\r\nPerform a HEAD request.\r\n\r\n- `$url` is a string representing the URL.\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$response = Curl::head($url, $options);\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n**Options**\r\n\r\nPerform an OPTIONS request.\r\n\r\n- `$url` is a string representing the URL.\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$response = Curl::options($url, $options);\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n**Patch**\r\n\r\nPerform a PATCH request.\r\n\r\n- `$url` is a string representing the URL.\r\n- `$data` is an array containing the data.\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `dataType` is a string representing the type of data to send with the request, and will default to \"*json*\".\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$response = Curl::patch($url, $data, $options);\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n**Post**\r\n\r\nPerform a POST request.\r\n\r\n- `$url` is a string representing the URL.\r\n- `$data` is an array containing the data.\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `dataType` is a string representing the type of data to send with the request, and will default to *null*.\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$response = Curl::post($url, $data, $options);\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n**Put**\r\n\r\nPerform a PUT request.\r\n\r\n- `$url` is a string representing the URL.\r\n- `$data` is an array containing the data.\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `dataType` is a string representing the type of data to send with the request, and will default to \"*json*\".\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$response = Curl::put($url, $data, $options);\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n\r\n## Curl Requests\r\n\r\nThis class extends the [*Request*](https://github.com/elusivecodes/FyreRequest) class.\r\n\r\n```php\r\nuse Fyre\\CURL\\CurlRequest;\r\n```\r\n\r\n- `$uri` is a [*Uri*](https://github.com/elusivecodes/FyreURI).\r\n- `$options` is an array containing the request options.\r\n    - `headers` is an array containing additional headers to set, and will default to *[]*.\r\n    - `data` is an array containing additional data to send with the request, and will default to *null*.\r\n    - `dataType` is a string representing the type of data to send with the request, and will default to \"*json*\".\r\n    - `userAgent` is a string representing the user agent, and will default to *null*.\r\n    - `protocolVersion` is a string representing the HTTP protocol version, and will default to \"*1.1*\".\r\n    - `username` is a string representing the HTTP authentication username, and will default to *null*.\r\n    - `password` is a string representing the HTTP authentication password, and will default to *null*.\r\n    - `auth` is a string representing the authentication method, and will default to \"*basic*\".\r\n    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.\r\n    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.\r\n    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.\r\n    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.\r\n    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.\r\n    - `redirectOptions` is an array containing redirect options.\r\n        - `max` is a number representing the maximum number of redirects, and will default to *5*.\r\n        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.\r\n        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO_HTTP | CURLPROTO_HTTPS*.\r\n    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.\r\n    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to *0*.\r\n    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to *0*.\r\n    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.\r\n\r\n```php\r\n$request = new CurlRequest($url, $options);\r\n```\r\n\r\n**Send**\r\n\r\nSend the request.\r\n\r\n```php\r\n$response = $request-\u003esend();\r\n```\r\n\r\nThis method returns a new [*CurlResponse*](#curl-responses).\r\n\r\n\r\n## Curl Responses\r\n\r\nThis class extends the [*Response*](https://github.com/elusivecodes/FyreResponse) class.\r\n\r\n```php\r\nuse Fyre\\CURL\\CurlResponse;\r\n```\r\n\r\n**Get Json**\r\n\r\nGet the response body as decoded JSON.\r\n\r\n- `$associative` is a boolean indicating whether to return JSON object as associative array, and will default to *true*.\r\n- `$depth` is a number representing the maximum depth of nesting, and will default to *512*.\r\n- `$flags` is a number representing additional flags to use for decoding, and will default to *0*.\r\n\r\n```php\r\n$data = $response-\u003egetJson($associative, $depth, $flags);\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrecurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyrecurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrecurl/lists"}