{"id":18673057,"url":"https://github.com/vicanso/go-axios","last_synced_at":"2025-10-10T10:05:16.187Z","repository":{"id":57492782,"uuid":"193507432","full_name":"vicanso/go-axios","owner":"vicanso","description":"HTTP Request package for golang.","archived":false,"fork":false,"pushed_at":"2023-12-21T12:18:42.000Z","size":119,"stargazers_count":49,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-18T21:43:18.456Z","etag":null,"topics":["axios","curl","go-axios","http","http-client","request"],"latest_commit_sha":null,"homepage":"https://treexie.gitbook.io/go-axios/","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/vicanso.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":"2019-06-24T13:07:28.000Z","updated_at":"2024-03-15T03:27:40.000Z","dependencies_parsed_at":"2023-12-21T14:10:24.963Z","dependency_job_id":"68a289e4-b5aa-439a-ae6a-9b7b2947fd2d","html_url":"https://github.com/vicanso/go-axios","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fgo-axios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fgo-axios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fgo-axios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fgo-axios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vicanso","download_url":"https://codeload.github.com/vicanso/go-axios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504246,"owners_count":21115138,"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":["axios","curl","go-axios","http","http-client","request"],"created_at":"2024-11-07T09:13:51.449Z","updated_at":"2025-10-10T10:05:11.150Z","avatar_url":"https://github.com/vicanso.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-axios\n\n[![Build Status](https://github.com/vicanso/go-axios/workflows/Test/badge.svg)](https://github.com/vicanso/go-axios/actions)\n\n简单易用的HTTP客户端，参考[axios](https://github.com/axios/axios)的相关实现，支持各类不同的`interceptor`与`transform`，特性如下：\n\n- 支持自定义的transform，可根据应用场景指定各类不同的参数格式\n- 支持Request与Response的interceptor，可针对请求参数与响应数据添加各类的转换处理\n- 默认支持gzip与br两种压缩方式，节约带宽占用\n- 支持启用请求中的各事件记录，可细化请求的各场景耗时\n- 简单易用的Mock处理\n- Error与Done事件的支持，通过监听事件可快捷收集服务的出错与性能统计\n\n```go\n// +build ignore\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/vicanso/go-axios\"\n)\n\nfunc main() {\n\t// 使用默认的配置\n\tresp, err := axios.Get(\"https://www.baidu.com\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(resp.Data)\n\n\t// 自定义instance，可指定client、interceptor等\n\tins := axios.NewInstance(\u0026axios.InstanceConfig{\n\t\tBaseURL:     \"https://www.baidu.com\",\n\t\tEnableTrace: true,\n\t\tClient: \u0026http.Client{\n\t\t\tTransport: \u0026http.Transport{\n\t\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t\t},\n\t\t},\n\t\t// 超时设置，建议设置此字段避免无接口无超时处理\n\t\tTimeout: 10 * time.Second,\n\t\t// OnDone 无论成功或失败均会调用，可在此处添加统计\n\t\tOnDone: func(config *axios.Config, resp *axios.Response, err error) {\n\t\t\tfmt.Println(config)\n\t\t\tfmt.Println(resp)\n\t\t\tfmt.Println(err)\n\t\t},\n\t})\n\tresp, err = ins.Get(\"/\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tbuf, _ := json.Marshal(resp.Config.HTTPTrace.Stats())\n\tfmt.Println(resp.Config.HTTPTrace.Stats())\n\tfmt.Println(string(buf))\n\tfmt.Println(resp.Config.HTTPTrace.Protocol)\n\tfmt.Println(resp.Status)\n\tfmt.Println(string(resp.Data))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicanso%2Fgo-axios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvicanso%2Fgo-axios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicanso%2Fgo-axios/lists"}