{"id":22525046,"url":"https://github.com/andrewpillar/req","last_synced_at":"2025-03-17T09:08:46.764Z","repository":{"id":37251153,"uuid":"441922951","full_name":"andrewpillar/req","owner":"andrewpillar","description":"A simple and opinionated HTTP scripting language","archived":false,"fork":false,"pushed_at":"2023-12-18T20:04:36.000Z","size":266,"stargazers_count":162,"open_issues_count":0,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-03T21:56:48.567Z","etag":null,"topics":["go","http","scripting-languages"],"latest_commit_sha":null,"homepage":"https://andrewpillar.com/programming/2022/02/26/req-an-http-scripting-language/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewpillar.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}},"created_at":"2021-12-26T15:26:39.000Z","updated_at":"2025-02-25T23:47:15.000Z","dependencies_parsed_at":"2024-01-29T08:09:49.769Z","dependency_job_id":"a9a0df1a-2958-47f1-b211-98a3f9e1bb46","html_url":"https://github.com/andrewpillar/req","commit_stats":{"total_commits":181,"total_committers":2,"mean_commits":90.5,"dds":"0.011049723756906049","last_synced_commit":"b9f4e7ada62a1829078ac202a30fab0e37959bbd"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewpillar%2Freq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewpillar%2Freq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewpillar%2Freq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewpillar%2Freq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewpillar","download_url":"https://codeload.github.com/andrewpillar/req/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006278,"owners_count":20382444,"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":["go","http","scripting-languages"],"created_at":"2024-12-07T06:08:04.565Z","updated_at":"2025-03-17T09:08:46.742Z","avatar_url":"https://github.com/andrewpillar.png","language":"Go","readme":"# req\n\nreq is an opinionated HTTP scripting language. It is designed for easily making\nHTTP requests, and working with their responses. Below is an example that calls\nout to the GitHub API and displays the user making the call,\n\n    $ cat gh.req\n    Stderr = open \"/dev/stderr\";\n\n    Endpoint = \"https://api.github.com\";\n    Token = env \"GH_TOKEN\";\n\n    if $Token == \"\" {\n        writeln $Stderr \"GH_TOKEN not set\";\n        exit 1;\n    }\n\n    Headers = (\n        Authorization: \"Bearer $(Token)\",\n    );\n\n    Resp = GET \"$(Endpoint)/user\" $Headers -\u003e send;\n\n    match $Resp.StatusCode {\n        200 -\u003e {\n            User = decode json $Resp.Body;\n\n            writeln _ \"Hello $(User[\"login\"])\";\n        }\n        _   -\u003e {\n            writeln $Stderr \"Unexpected response: $(Resp.Status)\";\n            exit 1;\n        }\n    }\n    $ GH_TOKEN=1a2b3c4d5ef req gh.req\n\nThis language hopes to fill in a gap when it comes to writing scripts for\nworking with an HTTP service. Typically, you have a choice between a shell\nscript that utilizes cURL, or a programmaing language and any HTTP library\nthat may come with it.\n\nThe cURL approach can work, for simple one off requests, but when you want to\ndo something more with the response you're left with having to munge that data\nwith jq, grep, sed, or awk (or all of the above). Using a programming language\ngives you more control, but can be more cumbersome as you have far many more\nknobs to turn.\n\nreq provides a middleground between the two. A limited syntax, with builtin\ncommands for working with any data you want to send/received. For more details\non how to start working with req, then refer to the [documentation](docs), or\nyou can dive right in by looking over the [examples](examples).\n","funding_links":[],"categories":["Uncategorized","Go"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewpillar%2Freq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewpillar%2Freq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewpillar%2Freq/lists"}