Crates.io | getsb |
lib.rs | getsb |
version | 0.1.2 |
source | src |
created_at | 2017-04-19 15:20:27.294452 |
updated_at | 2017-05-19 18:32:46.816973 |
description | Getsb is a command line tool for sending HTTP request. |
homepage | https://github.com/nsheremet/getsb-cli |
repository | https://github.com/nsheremet/getsb-cli |
max_upload_size | |
id | 11198 |
size | 32,419 |
Getsb is a command line tool for sending HTTP request.
$ cargo install getsb
You can download prebuilt binaries in the releases section, or create from source.
$ git clone https://github.com/nsheremet/getsb-cli.git
$ cd getsb-cli
$ cargo build --release
# sudo mv target/release/getsb /usr/local/bin
# sudo mv target/release/getsb /usr/local/bin/getsb
env
PATH
<path_stuff_here>;C:/getsb/;
This is the basic way to use getsb
.
$ getsb GET https://www.rust-lang.org/ # =>
# Status: 200
#
# Connection: close
# Last-Modified: Thu, 13 Apr 2017 20:18:15 GMT
# Age: 45525
# Server: AmazonS3
# Date: Thu, 13 Apr 2017 20:20:15 GMT
# Content-Type: text/html
# Content-Length: 1456
# X-Cache: Hit from cloudfront
#
# Body here
$ getsb POST https://example.com/api/data -b "key=value" -h "Content-Type: application/x-www-form-urlencoded" # =>
# Response
You can use json files for sending request.
This is example request file request.json
{
"url": "https://example.com/api/data",
"method": "PUT",
"headers": [
"Content-Type: application/json"
],
"body": {
"key": "value"
}
}
To send a request using this file:
$ getsb -r request.json # =>
# Response
$ getsb GET http://example.com -f response.dat # =>
# Response saved to file: response.dat
The canonical source of this repo is hosted on GitHub. If you have a GitHub account, please make your issues, and pull requests there.
(C) Copyright 2017 by Nazarii Sheremet
Getsb is distributed under the terms of both the MPL2.0 license.
See LICENSE for more information.