{"id":17933970,"url":"https://github.com/graphaelli/go-flag-http-headers","last_synced_at":"2025-06-20T14:37:12.227Z","repository":{"id":61625095,"uuid":"540254750","full_name":"graphaelli/go-flag-http-headers","owner":"graphaelli","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-23T02:52:24.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T11:29:02.847Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/graphaelli.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-09-23T02:50:38.000Z","updated_at":"2022-09-23T02:52:26.000Z","dependencies_parsed_at":"2022-10-19T21:00:47.779Z","dependency_job_id":null,"html_url":"https://github.com/graphaelli/go-flag-http-headers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/graphaelli/go-flag-http-headers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaelli%2Fgo-flag-http-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaelli%2Fgo-flag-http-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaelli%2Fgo-flag-http-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaelli%2Fgo-flag-http-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaelli","download_url":"https://codeload.github.com/graphaelli/go-flag-http-headers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaelli%2Fgo-flag-http-headers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260963111,"owners_count":23089547,"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-28T21:42:35.119Z","updated_at":"2025-06-20T14:37:07.213Z","avatar_url":"https://github.com/graphaelli.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Summary\n\n`go-flag-http-headers` provides a simple way to add a command line flag for specifying HTTP headers.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\n\theaderflag \"github.com/graphaelli/go-flag-http-headers\"\n)\n\nfunc main() {\n\thf := headerflag.New()\n\tflag.Var(hf, \"header\", \"HTTP header, can be specified multiple times\")\n\tflag.Parse()\n\n\treq, _ := http.NewRequest(http.MethodGet, \"http://example.com\", nil)\n\tfor h, vs := range hf.Headers() {\n\t\tfor _, v := range vs {\n\t\t\treq.Header.Add(h, v)\n\t\t}\n\t}\n\tb, _ := httputil.DumpRequest(req, false)\n\tfmt.Println(string(b))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaelli%2Fgo-flag-http-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaelli%2Fgo-flag-http-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaelli%2Fgo-flag-http-headers/lists"}