@flowscripter/io-plugin-http
v1.0.6
Published
HTTP and HTTPS source/sink plugin for https://github.com/flowscripter/pluggable-io-framework
Maintainers
Readme
io-plugin-http
HTTP and HTTPS source/sink plugin for pluggable-io-framework, loaded via dynamic-plugin-framework
Key Features
- One plugin registering two provider factories, for the
httpandhttpsprotocols, sharing onefetch-based implementation with thejspayload kind. - A location is a full URL plus optional request options:
methodfor writes (PUTby default, orPOST), basic auth (username/password), abearerToken, and extraheaders. Credentials are marked secret in the location schema. - Every location is a single entry; HTTP has no containers or patterns.
- Reads are
GETrequests. Readable handles areRangeReadable, using aRangeheader on a fresh request, so the framework can read in parts andseekableworks. - Writes stream the request body of one
PUTorPOST. getPropertiesusesHEAD(size, last modified, content type, etag) anddeleteusesDELETE.- Failures are classified for the framework's retries: network errors, timeouts, throttling and server errors are transient; other client errors are permanent.
Usage
Install the plugin where a
pluggable-io-framework
host discovers plugins, then address entries by URL (registry is a
discovered ProviderRegistry):
const { source, dest, options } = await registry.createProvidersForTransfer(
"https://example.com/data/report.csv",
"file:///tmp/report.csv",
);
await copy(source.provider, source.target, dest.provider, dest.target, options);Further Details
License
MIT © Flowscripter
