Asynchronous concurrent HTTP requests.
2.8K
A kgrv/mini:static image for asynchronous concurrent HTTP requests.
| OS/ARCH | Description |
|---|---|
linux/amd64 | 64-bit x86 architecture for Linux operating systems |
linux/arm64 | 64-bit ARM architecture for Linux operating systems |
| Type | Container | Function |
|---|---|---|
| Volume | /mnt | Bind mount volume |
docker run --tty -v $(pwd):/mnt kgrv/nreq --help
Usage: nreq [-i <input>] [-o <output>] [-r <rate>] [-t <timeout>] [-q] [-d] [--trace] [--version]
Asynchronous concurrent HTTP requests.
https://hub.docker.com/r/kgrv/nreq
Options:
-i, --input set input (default: nreq-conf.json)
-o, --output set output (default: nreq-resp.json)
-r, --rate set requests per duration
-t, --timeout set timeout duration
-q, --quiet quiet except WARN/ERROR
-d, --debug enable debug mode
--trace enable trace mode (verbose)
--version display version
--help, help display usage information
Examples:
nreq --input requests.json --output responses.json --timeout 1m30s
nreq --rate 100/1s
nreq --rate 100
| Code | Description |
|---|---|
0 | Successful completion |
1 | General unexpected application errors |
2 | External errors such as misconfiguration, non-permissive directory, etc |
3 | Successful completion with errors in HTTP responses |
Success:
INFO nreq > Exit Code: 0
Failure:
ERROR nreq > Exit Code: 2
-i/--input defaults to nreq-conf.json in current working directory.
docker run --tty -v $(pwd):/mnt kgrv/nreq
docker run --tty -v $(pwd):/mnt kgrv/nreq --input PATH
{
"requests": [
REQUEST_OBJECT,
..
]
}
Important
Available methods:
CONNECT,DELETE,GET*,HEAD,OPTIONS,PATCH,POST,PUT,TRACE* default
Tip
Only
urlis required.
{
"url": String,
"method": String,
"secret": Boolean,
"headers": Object,
"body": String
}
{
"requests": [
{
"url": "https://test.local/api/v1/?key=****",
"secret": true
},
..
]
}
Important
Duration format:
[0-9]+(ns|us|ms|[smhdwy])
-r/--rate defines as QUOTA/DURATION, omitting duration will default to 1s.-t/--timeout defines as DURATION.docker run --tty -v $(pwd):/mnt kgrv/nreq --rate 100/1s --timeout 1m30s
docker run --tty -v $(pwd):/mnt kgrv/nreq --rate 100 --timeout 90s
-o/--output defaults to nreq-resp.json in current working directory.
docker run --tty -v $(pwd):/mnt kgrv/nreq --output PATH
Running kgrv/nreq with URLs for kgrv/acso:
docker run --tty -v $(pwd):/mnt kgrv/nreq
nreq 0.5.1
INFO nreq > Process upload-conf.json
INFO nreq > Send 15 HTTP Requests
INFO nreq > 200 https://hub.docker.com/v2/repositories/kgrv/alpine
..
INFO nreq > Output upload-resp.json
INFO nreq > Runtime 1s 57ms
INFO nreq > Exit Code: 0
INFO nreq > Bye!
nreq packages errors into Response for further processing to streamline error handling, and avoid panic invalidating all concurrent requests.
Output nreq-resp.json without network access:
{
"package": "nreq/0.5.1",
"errors": [
"https://alpinelinux.org/releases"
],
"responses": {
"https://alpinelinux.org/releases": {
"url": "https://alpinelinux.org/releases",
"status": 2,
"version": "",
"headers": {},
"body": "io: failed to lookup address information: nodename nor servname provided, or not known"
}
}
}
Content type
Image
Digest
sha256:0bd66999e…
Size
1.5 MB
Last updated
27 days ago
docker pull kgrv/nreq