{"id":14966040,"url":"https://github.com/raku-community-modules/www","last_synced_at":"2025-11-10T16:06:32.257Z","repository":{"id":63885128,"uuid":"85104633","full_name":"raku-community-modules/WWW","owner":"raku-community-modules","description":"No-nonsense simple HTTPS client with JSON decoder","archived":false,"fork":false,"pushed_at":"2024-11-30T19:37:43.000Z","size":63,"stargazers_count":19,"open_issues_count":8,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T13:33:51.244Z","etag":null,"topics":["raku"],"latest_commit_sha":null,"homepage":"https://raku.land/zef:raku-community-modules/WWW","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raku-community-modules.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":"2017-03-15T17:58:53.000Z","updated_at":"2024-11-30T19:37:46.000Z","dependencies_parsed_at":"2025-02-10T16:43:10.123Z","dependency_job_id":null,"html_url":"https://github.com/raku-community-modules/WWW","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/raku-community-modules/WWW","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raku-community-modules%2FWWW","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raku-community-modules%2FWWW/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raku-community-modules%2FWWW/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raku-community-modules%2FWWW/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raku-community-modules","download_url":"https://codeload.github.com/raku-community-modules/WWW/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raku-community-modules%2FWWW/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283707650,"owners_count":26880806,"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","status":"online","status_checked_at":"2025-11-10T02:00:06.292Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["raku"],"created_at":"2024-09-24T13:35:44.502Z","updated_at":"2025-11-10T16:06:32.221Z","avatar_url":"https://github.com/raku-community-modules.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](logotype/logo_32x32.png) | ![Test](https://github.com/raku-community-modules/WWW/workflows/Test/badge.svg)[![Test-create and publish Docker images](https://github.com/raku-community-modules/WWW/actions/workflows/test-upload-ghcr.yaml/badge.svg)](https://github.com/raku-community-modules/WWW/actions/workflows/test-upload-ghcr.yaml)\n\n\n# NAME\n\nWWW - No-nonsense, simple HTTPS client with JSON decoder\n\n# SYNOPSIS\n\n```raku\nuse WWW;\n\n# Just GET content (will return Failure on failure):\nsay get 'https://httpbin.org/get?foo=42\u0026bar=x', :SomeHeader\u003cValue\u003e;\n\n# GET and decode received data as JSON:\nsay jget('https://httpbin.org/get?foo=42\u0026bar=x')\u003cargs\u003e\u003cfoo\u003e;\n\n# POST content (query args are OK; pass form as named args)\nsay post 'https://httpbin.org/post?foo=42\u0026bar=x', :some\u003cform\u003e, :42args;\n\n# And if you need headers, pass them inside a positional Hash:\nsay post 'https://httpbin.org/post?foo=42\u0026bar=x', %(:Some\u003cCustom-Header\u003e),\n    :some\u003cform\u003e, :42args;\n\n# Same POST as above + decode response as JSON\nsay jpost('https://httpbin.org/post', :some\u003cform-arg\u003e)\u003cform\u003e\u003csome\u003e;\n\n# Also can post() or jpost() POST body directly as Str:D; headers passed as named args:\nsay jpost(\n    \"http://httpbin.org/post\",\n    to-json({:42a, :foo\u003cmeows\u003e}),\n    :Authorization\u003cZofmeister\u003e\n).\u003cjson\u003e\u003cfoo\u003e;\n```\n\nImport more HTTP methods using `:extras`\n\n```raku\nuse WWW :extras;\n\nsay jdelete 'https://httpbin.org/delete';\nsay jput    'https://httpbin.org/put';\n```\n\n# DESCRIPTION\n\nExports a handful of routines to fetch data from online resources\nusing HTTP verbs and optionally decode the responses as JSON.\n\nThe module will set the `User-Agent` header to `Rakudo WWW`, unless you specify\nthat header.\n\n# INSTALLATION\n\nOn some operating systems you'll need `libssl` installed:\n\n```bash\nsudo apt-get install libssl-dev\n```\n\nThen just install the module with the module manager:\n\n```bash\nzef install WWW\n```\n\n# TESTING\n\nTo run the full test suite, set `ONLINE_TESTING` environmental variable to `1`\n\n```bash\nONLINE_TESTING=1 zef install WWW\n```\n\n# EXPORTED ROUTINES\n\n## `:DEFAULT` export tag\n\nThese routines get exported by default:\n\n### `get`\n\n```raku\nsub get($url where URI:D|Str:D, *%headers --\u003e Str:D);\n\nsay get 'https://httpbin.org/get?foo=42\u0026bar=x';\n```\n\nTakes either a `Str` or a [URI](https://modules.raku.org/dist/URI).\nReturns `Failure` if request fails or does not return a successful HTTP code.\nReturns `Str` with the data on success. Takes headers as named arguments.\n\n### `jget`\n\n```raku\nsay jget 'https://httpbin.org/get?foo=42\u0026bar=x';\n```\n\nSame as `get()` except will also decode the response as JSON and return\nresultant data structure.\n\n### `post`\n\n```raku\nmulti post($url where URI:D|Str:D, *%form --\u003e Str:D);\nmulti post($url where URI:D|Str:D, %headers, *%form --\u003e Str:D);\nmulti post($url where URI:D|Str:D, Str:D $form-body, *%headers --\u003e Str:D);\n\nsay post 'https://httpbin.org/post?meow=moo', :72foo, :bar\u003c♵\u003e;\nsay post 'https://httpbin.org/post?meow=moo',\n    %(Content-type =\u003e 'application/json'), :72foo, :bar\u003c♵\u003e;\n```\n\nTakes either a `Str` or a [URI](https://modules.raku.org/dist/URI), followed\nby an optional `Hash` with HTTP headers to send. Form POST parameters can be\nincluded as named arguments. It's fine to also include query arguments in the\nURL itself. Returns `Failure` if request fails or does not return a successful\nHTTP code. Returns `Str` with the data on success.\n\nTo send POST body directly, pass it as Str:D positional arg. In this calling\nform, the headers are sent as named args.\n\n### `jpost`\n\n```raku\nmulti jpost($url where URI:D|Str:D, *%form);\nmulti jpost($url where URI:D|Str:D, %headers, *%form);\nmulti jpost($url where URI:D|Str:D, Str:D $form-body, *%headers);\n\nsay jpost 'https://httpbin.org/post?meow=moo', :72foo, :bar\u003c♵\u003e;\nsay jpost 'https://httpbin.org/post?meow=moo',\n    %(Content-type =\u003e 'application/json'), :72foo, :bar\u003c♵\u003e;\n```\n\nSame as `post()` except will also decode the response as JSON and return\nresultant data structure.\n\n### `head`\n\n```raku\nsay head 'https://httpbin.org/get?foo=42\u0026bar=x';\n```\n\nSame as `get`, except it does not actually download the content, just the head.\n\n\n## `:extras` Export Tag\n\nThese routines get exported *in addition to* the `:DEFAULT` exports, when\n`:extras` export tag is requested:\n\n```raku\nuse WWW :extras;\n```\n\n### `put`\n\n```raku\nmulti put($url where URI:D|Str:D, *%form --\u003e Str:D);\nmulti put($url where URI:D|Str:D, %headers, *%form --\u003e Str:D);\nmulti put($url where URI:D|Str:D, Str:D $form-body, *%headers --\u003e Str:D);\n\nsay put 'https://httpbin.org/put?meow=moo', :72foo, :bar\u003c♵\u003e;\nsay put 'https://httpbin.org/put?meow=moo',\n    %(Content-type =\u003e 'application/json'), :72foo, :bar\u003c♵\u003e;\n```\n\nTakes either a `Str` or a [URI](https://modules.raku.org/dist/URI), followed\nby an optional `Hash` with HTTP headers to send. Form PUT parameters can be\nincluded as named arguments. It's fine to also include query arguments in the\nURL itself. Returns `Failure` if request fails or does not return a successful\nHTTP code. Returns `Str` with the data on success.\n\nTo send PUT body directly, pass it as Str:D positional arg. In this calling\nform, the headers are sent as named args.\n\n### `jput`\n\n```raku\nmulti jput($url where URI:D|Str:D, *%form --\u003e Str:D);\nmulti jput($url where URI:D|Str:D, %headers, *%form --\u003e Str:D);\nmulti jput($url where URI:D|Str:D, Str:D $form-body, *%headers --\u003e Str:D);\n\nsay jput 'https://httpbin.org/put?meow=moo', :72foo, :bar\u003c♵\u003e;\nsay jput 'https://httpbin.org/put?meow=moo',\n    %(Content-type =\u003e 'application/json'), :72foo, :bar\u003c♵\u003e;\n```\n\nSame as `put()` except will also decode the response as JSON and return\nresultant data structure.\n\n### `delete`\n\n```raku\nsub delete($url where URI:D|Str:D, *%headers --\u003e Str:D);\n\nsay delete 'https://httpbin.org/get?foo=42\u0026bar=x';\n```\n\nPerforms HTTP `DELETE` request.\nTakes either a `Str` or a [URI](https://modules.raku.org/dist/URI).\nReturns `Failure` if request fails or does not return a successful HTTP code.\nReturns `Str` with the data on success; if response for a `204 No Content`,\nreturns an empty string. Takes headers as named arguments.\n\n### `jdelete`\n\n```raku\nsay jdelete 'https://httpbin.org/get?foo=42\u0026bar=x';\n```\n\nSame as `delete()` except will also decode the response as JSON and return\nresultant data structure.\n\nYou probably want to use `delete()` instead, as `DELETE` requests can get\nreturn no content, causing JSON parse failures.\n\n# LIMITATIONS\n\nDue to nuances of upstream code, currently any non-RFC-conformant URL will\nbe rejected; you have to ensure it's proper manually. Patches welcome.\n\n# SEE ALSO\n\n- [`LWP::Simple`](https://raku.land/zef:raku-community-modules/LWP::Simple)\n- [`HTTP::UserAgent`](https://raku.land/github:sergot/HTTP::UserAgent)\n\n----\n\n#### REPOSITORY\n\nFork this module on GitHub:\nhttps://github.com/raku-community-modules/WWW\n\n#### BUGS\n\nTo report bugs or request features, please use\nhttps://github.com/raku-community-modules/WWW/issues\n\n#### ORIGINAL AUTHOR\n\nZoffix Znet (http://perl6.party/)\n\nNow maintained by the Raku community as part of the [Raku community modules](https://github.com/raku-community-modules)\n\n#### LICENSE\n\nYou can use and distribute this module under the terms of the\nThe Artistic License 2.0. See the `LICENSE` file included in this\ndistribution for complete details.\n\nThe `META6.json` file of this distribution may be distributed and modified\nwithout restrictions or attribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraku-community-modules%2Fwww","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraku-community-modules%2Fwww","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraku-community-modules%2Fwww/lists"}