Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mholt/curl-to-go
Convert curl commands to Go code in your browser
https://github.com/mholt/curl-to-go
curl curl-commands go golang
Last synced: 5 days ago
JSON representation
Convert curl commands to Go code in your browser
- Host: GitHub
- URL: https://github.com/mholt/curl-to-go
- Owner: mholt
- License: mit
- Created: 2016-01-27T04:37:30.000Z (almost 9 years ago)
- Default Branch: gh-pages
- Last Pushed: 2022-07-11T16:07:33.000Z (over 2 years ago)
- Last Synced: 2024-11-21T02:54:45.876Z (21 days ago)
- Topics: curl, curl-commands, go, golang
- Language: JavaScript
- Homepage: https://mholt.github.io/curl-to-go
- Size: 287 KB
- Stars: 1,801
- Watchers: 33
- Forks: 166
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-repositories - mholt/curl-to-go - Convert curl commands to Go code in your browser (JavaScript)
- awesome-golang-repositories - curl-to-go
- awesome-list - curl-to-go
- awesome-client-side - curl-to-go - Convert curl commands to Go code in your browser - [Try it!](https://mholt.github.io/curl-to-go/) (Langages / Golang)
README
curl-to-Go
===========curl-to-Go is a tool to instantly convert [curl](http://curl.haxx.se) 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](https://mholt.github.io/json-to-go), which converts JSON to a Go struct type definition. To do the reverse, check out [moul/http2curl](https://github.com/moul/http2curl).
### Try it
**[Check it out!](https://mholt.github.io/curl-to-go)** It works inside your browser. Just give the code a once-over since it will need you to flesh 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](https://twitter.com/mholt6)). Enjoy!