curl-to-go

Convert curl commands to Go code in your browser

Github星跟踪图

curl-to-Go

curl-to-Go is a tool to instantly convert curl commands to Go code in the browser. It does not guarantee high-fidelity conversions, but it's good enough for most API docs that have curl samples.

This is a sister tool to JSON-to-Go, which converts JSON to a Go struct type definition. To do the reverse, check out moul/http2curl.

Try it

Check it out! It works inside your browser. Just give the code a once-over since it will need you to flush out some parts like error handling.

FAQ

Does any curl command work?

Any curl command should work, but only certain flags are understood and converted into Go code. The rest of the flags will be ignored.

Which kinds of curl commands are understood?

Mostly simple HTTP commands (headers, basic auth, body, etc).

Will you consider supporting this-or-that flag?

curl has like a bajillion options, so don't expect all of them to be implemented; just the most common/important ones to stub out code from API samples and docs, etc. But feel free to open an issue or submit a pull request! To request a new flag, please provide the equivalent Go code.

Credits

curl-to-Go is brought to you by Matt Holt (mholt6). Enjoy!

主要指标

概览
名称与所有者mholt/curl-to-go
主编程语言JavaScript
编程语言HTML (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2016-01-27 04:37:30
推送于2024-11-26 22:25:56
最后一次提交
发布数0
用户参与
星数1.8k
关注者数32
派生数167
提交数55
已启用问题?
问题数32
打开的问题数8
拉请求数20
打开的拉请求数2
关闭的拉请求数3
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?