pietercolpaert / ldfetch

An HTTP client for RDF resources
https://www.npmjs.com/package/ldfetch
15 stars 4 forks source link

Refactoring: enable access to a HTTP client without parsing, but with redirects and caching #6

Open pietercolpaert opened 7 years ago

pietercolpaert commented 7 years ago

Related to #4 and #5

To be used for the JSON-LD document loader

pietercolpaert commented 6 years ago

Refactoring should look like this:

parts only for NodeJS

HTTP+HTTPS+HTTP2 nodejs module ↓ cacheable-request module -- make this configurable ↓ follow-redirects module (and before this step, this HTTP is also the base for the HTTP module of follow-redirect module) ↓ Decompress: https://www.npmjs.com/package/decompress-response ↓ This is the NodeHTTPFetcher (this is also the base for the JSON-LD document loader)

Browser + NodeJS version

NodeJS starts from the NodeHTTPFetcher as documented above. The Browser version starts from the browser fetch module, which already implements all of the above. ↓ Promisify result of a HTTP request ↓ Deserializer (popular RDF serializations, conneg, ...) ↓ Extract metadata such as:

pietercolpaert commented 6 years ago

Important is that we should always be able to stop a request

pietercolpaert commented 6 years ago

Being tackled in https://github.com/pietercolpaert/ldfetch/tree/fix-6