{"id":18378646,"url":"https://github.com/creatcodebuild/h","last_synced_at":"2025-04-11T08:29:46.501Z","repository":{"id":93996649,"uuid":"135774393","full_name":"CreatCodeBuild/h","owner":"CreatCodeBuild","description":"http for Gophers, and human","archived":false,"fork":false,"pushed_at":"2018-06-12T08:27:37.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T22:43:10.981Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CreatCodeBuild.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":"2018-06-02T00:22:48.000Z","updated_at":"2018-06-12T08:27:38.000Z","dependencies_parsed_at":"2023-04-26T11:32:01.126Z","dependency_job_id":null,"html_url":"https://github.com/CreatCodeBuild/h","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreatCodeBuild%2Fh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreatCodeBuild%2Fh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreatCodeBuild%2Fh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreatCodeBuild%2Fh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CreatCodeBuild","download_url":"https://codeload.github.com/CreatCodeBuild/h/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361395,"owners_count":21090887,"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-11-06T00:34:40.097Z","updated_at":"2025-04-11T08:29:46.431Z","avatar_url":"https://github.com/CreatCodeBuild.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# H\n__http for Gophers, and human__\n\nGo std lib `net/http` is easy to use, but verbose. Package `h` provides a simply yet flexible API for Gophers and other human. Readable, maintainable, debuggable, extendable and flexible API is the goal.\n\n## Usage\n### Basic\n```go\nclient := NewClient().\n    SetBaseURL(\"baseURL\").\n    SetHeader(\"Header1\", \"Value\").\n    SetHeader(\"Header2\", \"Value\").\n    Use(func(r *Request, res *http.Response, err error) (*http.Response, error) {\n        if res.StatusCode == 500 {\n        \tlog.Fatal(500)\n        }\n    }).\n    SetTimeout(5 * time.Second)\n\nres, err := client.Request(http.MethodGet, \"www.google.com\").\n\tSetHeader(\"Header3\", \"Value\").\n\tSetBody(strings.NewReader(\"123\")).\n\tRun()\n```\nThis returns a standard `(http.Response, error)` pair, same return signature as `http.Client.Do` function.\n\nAs you can see, a convenient method chaining API is provided.\n\n### Plugins\nThe power of `h` comes in with plugins. `h` itself has less than 120 lines of code. But it has a extendable design.\n\n`h/hplug` package provides several powerful plugins, including retries. Please see [hplug examples](plugin/retry/retry_test.go).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreatcodebuild%2Fh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreatcodebuild%2Fh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreatcodebuild%2Fh/lists"}