{"id":36816711,"url":"https://github.com/x-mod/httpclient","last_synced_at":"2026-01-12T13:54:26.240Z","repository":{"id":57490272,"uuid":"184500558","full_name":"x-mod/httpclient","owner":"x-mod","description":"http client with smooth interfaces","archived":false,"fork":false,"pushed_at":"2021-05-04T07:15:38.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T08:13:30.449Z","etag":null,"topics":["http","http-client","request","response"],"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/x-mod.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":"2019-05-02T00:40:56.000Z","updated_at":"2024-06-21T08:13:30.450Z","dependencies_parsed_at":"2022-09-08T06:31:32.431Z","dependency_job_id":null,"html_url":"https://github.com/x-mod/httpclient","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/x-mod/httpclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-mod%2Fhttpclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-mod%2Fhttpclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-mod%2Fhttpclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-mod%2Fhttpclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-mod","download_url":"https://codeload.github.com/x-mod/httpclient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-mod%2Fhttpclient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["http","http-client","request","response"],"created_at":"2026-01-12T13:54:26.164Z","updated_at":"2026-01-12T13:54:26.227Z","avatar_url":"https://github.com/x-mod.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"httpclient\n===\n[![Build Status](https://travis-ci.org/x-mod/httpclient.svg?branch=master)](https://travis-ci.org/x-mod/httpclient) [![Go Report Card](https://goreportcard.com/badge/github.com/x-mod/httpclient)](https://goreportcard.com/report/github.com/x-mod/httpclient) [![Coverage Status](https://coveralls.io/repos/github/x-mod/httpclient/badge.svg?branch=master)](https://coveralls.io/github/x-mod/httpclient?branch=master) [![GoDoc](https://godoc.org/github.com/x-mod/httpclient?status.svg)](https://godoc.org/github.com/x-mod/httpclient) \n\nMore smooth package for http operations as a client:\n\n- http request builder\n- http response processor\n- http client extension\n\n### http.Request Builder\n\n````go\n\nimport \"github.com/x-mod/httpclient\"\n\nrequestBuilder := httpclient.NewRequestBuilder(\n        httpclient.URL(\"https://url\"),\n        httpclient.Method(\"GET\"),\n        httpclient.Query(\"key\", \"value\"),\n        httpclient.Header(\"key\", \"value\"),\n        httpclient.BasicAuth(\"user\", \"pass\"),\n        httpclient.Credential(*tlsconfig),\n        httpclient.Body(\n            httpclient.JSON(map[string]interface{}{\n                \"a\": \"hello\",\n                \"b\": true,\n                \"c\": 1,\n            }),\n        ),\n    )\n\nreq, err := requestBuilder.Get()\n\n````\n\n### http.Response Processor\n\n````go\n//ResponseProcessor interface\ntype ResponseProcessor interface {\n\tProcess(context.Context, *http.Response) error\n}\n````\n\nImplement your own ResponseProcessor\n\n### http.Client Extension\n\nextend the http.Client with more useful interfaces:\n\n````go\nimport \"github.com/x-mod/httpclient\"\n\nclient := httpclient.New(\n    httpclient.MaxConnsPerHost(16),\n    httpclient.Retry(3),\n    httpclient.Response(\n        httpclient.NewDumpResponse(),\n    ),\n)\n\n//get standard http.Client\nc := client.GetClient()\n//get standard http.Transport\ntr := client.GetTransport()\n\n//extension fn\nerr := client.Execute(context.TODO())\nerr := client.ExecuteRequest(context.TODO(), request)\n\n````","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-mod%2Fhttpclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-mod%2Fhttpclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-mod%2Fhttpclient/lists"}