Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhawthorn/curl-to-ruby
:arrow_down: Convert a curl command into ruby's net/http
https://github.com/jhawthorn/curl-to-ruby
curl curl-commands http ruby
Last synced: 3 days ago
JSON representation
:arrow_down: Convert a curl command into ruby's net/http
- Host: GitHub
- URL: https://github.com/jhawthorn/curl-to-ruby
- Owner: jhawthorn
- License: mit
- Created: 2016-05-22T21:33:11.000Z (over 8 years ago)
- Default Branch: gh-pages
- Last Pushed: 2023-01-03T18:22:31.000Z (about 2 years ago)
- Last Synced: 2025-01-23T03:11:53.955Z (11 days ago)
- Topics: curl, curl-commands, http, ruby
- Language: JavaScript
- Homepage: https://jhawthorn.github.io/curl-to-ruby/
- Size: 1.09 MB
- Stars: 238
- Watchers: 6
- Forks: 19
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
curl-to-ruby
============curl-to-ruby is a tool to instantly convert [curl](http://curl.haxx.se) commands to ruby code using [net/http](http://ruby-doc.org/stdlib-2.1.1/libdoc/net/http/rdoc/Net/HTTP.html) in the browser. It does *not* guarantee high-fidelity conversions, but it's good enough for most API docs that have curl samples.
### Try it
**[Check it out!](https://jhawthorn.github.io/curl-to-ruby)** It works inside your browser.
### FAQ
#### Does any curl command work?
Any curl command should work, but only certain flags are understood and converted into ruby 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!
### Credits
Updated to ruby by John Hawthorn ([jhawthorn](https://twitter.com/jhawthorn))
Based on [curl-to-Go](https://github.com/mholt/curl-to-go) by Matt Holt ([mholt6](https://twitter.com/mholt6)).