#cli #surf

app longboard

the easy way to surf

4 releases

0.0.2-alpha.4 Oct 13, 2020
0.0.2-alpha.2 Oct 12, 2020

#70 in Filesystem

MIT/Apache and LGPL-3.0-or-later

31KB
141 lines

Longboard: The easy way to surf

$ longboard get https://async.rs

TODO for this to be useful

  • request bodies
    • from filesystem
    • as a cli arg
    • from stdin (pipe)
  • request headers
  • opt into / out of displaying different parts of request and response
  • http status -> exit codepp

Installation

$ cargo install longboard --version 0.0.2-alpha.4

Usage

longboard 0.0.2-alpha.4
the easy way to surf

USAGE:
    longboard [OPTIONS] <method> <url>

FLAGS:
        --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -b, --body <body>             provide a request body on the command line
    -c, --client <client>         http backend for surf. options: h1, curl, hyper [default: h1]
    -f, --file <file>             provide a the path to a file to use as the request body
    -h, --headers <headers>...    provide headers in the form -h KEY1=VALUE1 KEY2=VALUE2

ARGS:
    <method>
    <url>

Examples to try:

$ longboard get http://httpin.org/get
$ longboard get https://httpbin.org/headers -h Some-Header="header value" User-Agent=longboard
$ longboard post https://httpbin.org/post -b "this is a request body"
$ longboard post http://httpbin.org/anything -b "a=b&c=d" -h content-type=application/x-www-form-urlencoded
$ longboard put https://httpbin.org/put -f ./Cargo.toml -h content-type=application/toml
$ longboard patch https://httpbin.org/patch < ./some-file
$ cat /dev/random | head -c1000 | base64 | longboard post https://httpbin.org/anything 

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~31MB
~621K SLoC