{"id":13786633,"url":"https://github.com/valord577/httpc","last_synced_at":"2025-12-16T01:30:14.047Z","repository":{"id":57622602,"uuid":"394980626","full_name":"valord577/httpc","owner":"valord577","description":"A customizable and simple HTTP client library. Only depend on the stdlib HTTP client.","archived":true,"fork":false,"pushed_at":"2021-11-22T04:21:25.000Z","size":14,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-03T19:10:00.240Z","etag":null,"topics":["go","http-client"],"latest_commit_sha":null,"homepage":"","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/valord577.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE.md","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-08-11T12:26:27.000Z","updated_at":"2023-01-28T05:13:28.000Z","dependencies_parsed_at":"2022-09-26T20:10:47.487Z","dependency_job_id":null,"html_url":"https://github.com/valord577/httpc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valord577%2Fhttpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valord577%2Fhttpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valord577%2Fhttpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valord577%2Fhttpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valord577","download_url":"https://codeload.github.com/valord577/httpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225101328,"owners_count":17421074,"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-client"],"created_at":"2024-08-03T19:01:20.422Z","updated_at":"2025-12-16T01:30:14.016Z","avatar_url":"https://github.com/valord577.png","language":"Go","readme":"Httpc\n======\n\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/valord577/httpc?t=2)](https://goreportcard.com/report/github.com/valord577/httpc)\n[![Go Reference](https://pkg.go.dev/badge/github.com/valord577/httpc.svg)](https://pkg.go.dev/github.com/valord577/httpc)\n[![GitHub](https://img.shields.io/github/license/valord577/httpc?t=0)](LICENSE)\n\nA customizable and simple HTTP client library. Only depend on the stdlib HTTP client.\n\nRequirements\n------\n\n- Go 1.14 or higher.\n\nFeatures\n------\n\n- Simple and easy to use\n- Make HTTP calls customizable\n\nInstalling\n------\n\ngo mod:\n\n```shell\ngo get github.com/valord577/httpc\n```\n\nExample\n------\n\n\u003cdetails\u003e\n\u003csummary\u003e\n- Do HTTP calls\n\u003c/summary\u003e\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"net/http\"\n    \n    \"github.com/valord577/httpc\"\n)\n\nfunc main() {\n    c := httpc.PackedReq{\n        URL:              \"https://www.google.com\",\n        Method:           http.MethodGet,\n        ReqBodyPublisher: httpc.PublisherNoBody{},\n        RespBodyHandler:  httpc.RespBodyAsByteArray{},\n    }\n\n    bs, err := c.Send()\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"%s\", bs)\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n- Customize the processing of response body\n\u003c/summary\u003e\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"io\"\n    \"net/http\"\n    \n    \"github.com/valord577/httpc\"\n)\n\ntype RespBodyAsString struct {}\n\nfunc (r RespBodyAsString) Apply(body io.ReadCloser) (interface{}, error) {\n    bs, err := io.ReadAll(body)\n    if err != nil {\n        return nil, err\n    }\n    return string(bs), nil\n}\n\nfunc main() {\n    c := httpc.PackedReq{\n        URL:              \"https://www.google.com\",\n        Method:           http.MethodGet,\n        ReqBodyPublisher: httpc.PublisherNoBody{},\n        RespBodyHandler:  RespBodyAsString{},\n    }\n\n    bs, err := c.Send()\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"%s\", bs)\n}\n```\n\u003c/details\u003e\n\nChanges\n------\n\nSee the [CHANGES](CHANGE.md) for changes.\n\nLicense\n------\n\nSee the [LICENSE](LICENSE) for Rights and Limitations (MIT).\n","funding_links":[],"categories":["Networking","HTTP Clients","网络"],"sub_categories":["HTTP Clients","HTTP客户端"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalord577%2Fhttpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalord577%2Fhttpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalord577%2Fhttpc/lists"}