https://github.com/kimromi/rcurl
➰ curl command wrapper - writable yaml + erb config file
https://github.com/kimromi/rcurl
curl ruby
Last synced: 11 months ago
JSON representation
➰ curl command wrapper - writable yaml + erb config file
- Host: GitHub
- URL: https://github.com/kimromi/rcurl
- Owner: kimromi
- Created: 2018-03-26T12:04:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T18:59:09.000Z (almost 8 years ago)
- Last Synced: 2025-02-17T17:48:22.652Z (12 months ago)
- Topics: curl, ruby
- Language: Ruby
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rcurl
Simple curl command wrapper
## Installation
$ gem install rcurl
## Usage
### GET
Create example.yaml
```yaml
method: GET
params:
hoge: fuga
```
execute `rcurl` command with option `-d`
```console
$ rcurl -d @path/to/example.yaml http://example.com
# => curl -sS -X GET http://example.com?hoge=fuga
```
### POST (application/x-www-form-urlencoded)
example.yaml
```yaml
method: POST
params:
hoge: fuga
```
```console
$ rcurl -d @path/to/example.yaml http://example.com
# => curl -sS -X POST -d 'hoge=fuga' http://example.com
```
### POST (application/json)
example.yaml
```yaml
method: POST
headers:
- 'Content-type: application/json'
params:
hoge: fuga
```
```console
$ rcurl -d @path/to/example.yaml http://example.com
# => curl -sS -X POST -H 'Content-type: application/json' -d '{"hoge":"fuga"}' http://example.com
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/kimromi/rcurl.