https://github.com/vi/line2httppost
Command-line HTTP client for sending a POST request to specified URI on each stdin line.
https://github.com/vi/line2httppost
Last synced: about 1 year ago
JSON representation
Command-line HTTP client for sending a POST request to specified URI on each stdin line.
- Host: GitHub
- URL: https://github.com/vi/line2httppost
- Owner: vi
- Created: 2022-10-25T00:05:43.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-25T08:20:04.000Z (over 3 years ago)
- Last Synced: 2025-04-15T14:13:30.915Z (about 1 year ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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](https://github.com/vi/postsse), allowing to feed CLI tools output to it.
# 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 reponse 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](https://github.com/vi/line2httppost/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
```