line2httppost

Crates.ioline2httppost
lib.rsline2httppost
version0.1.0
sourcesrc
created_at2022-10-25 00:07:04.824828
updated_at2022-10-25 00:07:04.824828
descriptionSimple HTTP client that POSTs each incoming stdin command line to specified URL, reusing the connection if possible
homepage
repositoryhttps://github.com/vi/line2httppost
max_upload_size
id696372
size21,776
Vitaly Shukela (vi)

documentation

README

line2httppost

Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though).

Good together with postsse.

Features

  • Connects to http and https, both http1 and http2.
  • Logging of errors during connection or failed response statuses.

Limitations

  • No advanced options like line delimiter
  • It waits for reposnse from server before sending the next line, so RTT affects thoughput.
  • Each line is fully buffered prior to starting the request, no streaming/chunking.

Installation

Download pre-built executables from Github releases, install it from source code with cargo install --path . or from crates.io with cargo install line2httppost.

Example

$ line2httppost http://example.com
123
ABC
POST / HTTP/1.1
content-type: text/plain
host: example.com
content-length: 3

123

POST / HTTP/1.1
content-type: text/plain
host: example.com
content-length: 3

ABC
Commit count: 2

cargo fmt