{"id":15514809,"url":"https://github.com/fgasper/p5-net-curl-easier","last_synced_at":"2025-03-28T19:21:35.596Z","repository":{"id":56837660,"uuid":"339679145","full_name":"FGasper/p5-Net-Curl-Easier","owner":"FGasper","description":"CPAN’s Net::Curl::Easier","archived":false,"fork":false,"pushed_at":"2021-02-24T00:36:36.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-02T20:51:09.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FGasper.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2021-02-17T10:00:09.000Z","updated_at":"2021-02-24T00:36:38.000Z","dependencies_parsed_at":"2022-09-10T01:10:42.134Z","dependency_job_id":null,"html_url":"https://github.com/FGasper/p5-Net-Curl-Easier","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/FGasper%2Fp5-Net-Curl-Easier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Net-Curl-Easier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Net-Curl-Easier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Net-Curl-Easier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FGasper","download_url":"https://codeload.github.com/FGasper/p5-Net-Curl-Easier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246085655,"owners_count":20721213,"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":[],"created_at":"2024-10-02T10:00:39.166Z","updated_at":"2025-03-28T19:21:35.568Z","avatar_url":"https://github.com/FGasper.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nNet::Curl::Easier - Convenience wrapper around [Net::Curl::Easy](https://metacpan.org/pod/Net::Curl::Easy)\n\n# SYNOPSIS\n\n    my $easy = Net::Curl::Easier-\u003enew( url =\u003e 'http://perl.org' )-\u003eperform();\n\n    print $easy-\u003ebody();\n\n    # … or, to dig in to the response:\n    my $response = HTTP::Response-\u003eparse( $easy-\u003ehead() . $easy-\u003ebody() );\n\n# DESCRIPTION\n\n[Net::Curl](https://metacpan.org/pod/Net::Curl) is wonderful, but [Net::Curl::Easy](https://metacpan.org/pod/Net::Curl::Easy) is a bit clunky for\nday-to-day use. This library attempts to make that, well, “easier”. :-)\n\nThis module extends Net::Curl::Easy, with differences as noted here:\n\n# DIFFERENCES FROM Net::Curl::Easy\n\n- The response headers and body go to an internal buffer by default.\nNet::Curl::Easy simply adopts libcurl’s defaults, which is understandable\nbut frequently unhelpful.\n- Character encoding. As of this writing Net::Curl::Easy uses\n[SvPV](https://perldoc.perl.org/perlapi#SvPV) to translate Perl strings to C,\nwhich means that what libcurl receives depends on how Perl internally stores\nyour string. Thus, the same string given to Net::Curl::Easy can yield\ndifferent input to libcurl depending on how Perl has decided to store that\nstring.\n\n    This library fixes that by requiring all strings that it receives\n    to be **byte** **strings** and normalizing Perl’s internal storage before\n    calling into Net::Curl::Easy.\n\n- Several methods are wrapped, as described below.\n\n# SEE ALSO\n\n- [Net::Curl::Promiser](https://metacpan.org/pod/Net::Curl::Promiser) wraps [Net::Curl::Multi](https://metacpan.org/pod/Net::Curl::Multi) with promises.\nRecommended for concurrent queries!\n- [Net::Curl::Simple](https://metacpan.org/pod/Net::Curl::Simple) takes a similar approach to this module but\npresents a substantially different interface.\n\n# METHODS\n\nBesides those inherited from Net::Curl::Easy, this class defines:\n\n## $obj = _OBJ_-\u003eset( $NAME1 =\u003e $VALUE1, $NAME2 =\u003e $VALUE2, .. )\n\n`setopt()`s multiple values in a single call. Instead of:\n\n    $easy-\u003esetopt( Net::Curl::Easy::CURLOPT_URL, 'http://perl.org' );\n    $easy-\u003esetopt( Net::Curl::Easy::CURLOPT_VERBOSE, 1 );\n\n… you can do:\n\n    $easy-\u003eset( url =\u003e 'http://perl.org', verbose =\u003e 1 );\n\nSee [curl\\_easy\\_setopt(3)](http://man.he.net/man3/curl_easy_setopt) for the full set of options you can give here.\n\nNote that, since _OBJ_ is returned, you can chain calls to this with\ncalls to other methods like `perform()`.\n\nYou may not need to call this method since `new()` calls it for you.\n\n## $obj = _OBJ_-\u003epush( $NAME1 =\u003e \\\\@VALUES1, $NAME2 =\u003e \\\\@VALUES2, .. )\n\nLike `set()`, but for `pushopt()`.\n\n## $value = _OBJ_-\u003eget($NAME)\n\nLike `set()`, but for `getinfo()`. This, of course, doesn’t return\n_OBJ_, so it can’t be chained.\n\n## $str = _OBJ_-\u003ehead()\n\nReturns _OBJ_’s internal HTTP response header buffer, as a byte string.\n\n## $str = _OBJ_-\u003ebody()\n\nReturns the HTTP response body, as a byte string.\n\n# WRAPPED METHODS\n\n- `new()` takes a list of key/value pairs and passes it to\nan internal call to `set()`. The returned object will always be a\n(newly-created) hash reference.\n- `escape()` and `send()` apply the character encoding fix described\nabove.\n- `setopt()` and `pushopt()` fix character encoding and return\nthe instance object.\n- `perform()` returns the instance object.\n\n# STATIC FUNCTIONS\n\nFor convenience, `Net::Curl::Easy::strerror()` is aliased in this module.\n\n# LICENSE \u0026 COPYRIGHT\n\nCopyright 2021 by Gasper Software Consulting. All rights reserved.\n\nThis library is licensed under the same terms as Perl itself.\nSee [perlartistic](https://metacpan.org/pod/perlartistic) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgasper%2Fp5-net-curl-easier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgasper%2Fp5-net-curl-easier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgasper%2Fp5-net-curl-easier/lists"}