chunk-fetch
v25.0.4
Published
Use the same `fetch()` API browsers provide for HTTP, but for IPFS
Downloads
135
Readme
chunk-fetch
example of how a url looks like using chunk-fetch
ipfs://someCidAsHostname/some/path
_
- hostname is ignored, url will start with the path and the path becomes the query, so ipfs://_/somepath becomes ipfs://somepath
CID
- a CID that is used for the query
method: HEAD
- does not return a body, only returns headers
hostname:
_
- ignores the hostname, path becomes the query path:/path/to/dir/or/file
- it can be any path including/
, this path is the query that will be used with ipfs headers:X-Copy
-true
|false
- if true, a directory will be created with the CID, the data will be stored inside that directory. if false, the data will be stored using the path but without the new directory.X-Timer
-String
- a number for a timeout
CID
- a CID identifier for some data path:/
- used for a directory,if theCID
is a directory headers:X-Copy
-true
|false
- if true, a directory will be created with the CID, the data will be stored inside that directory. if false, the data will be stored using the path but without the new directory.X-Timer
-String
- a number for a timeout
/path/to/file
- used for a file, if theCID
is a file headers:X-Copy
-true
|false
- if true, a directory will be created with the CID, the data will be stored inside that directory. if false, the data will be stored using the path but without the new directory.X-Timer
-String
- a number for a timeout
method: GET
- return a body
hostname:
_
- ignores the hostname, path becomes the query path:/path/to/dir/or/file
- it can be any path including/
, this path is the query that will be used with ipfs headers:X-Timer
-String
- a number for a timeout
CID
- a CID identifier for some data path:/
- used for a directory if theCID
is a directory headers:X-Timer
-String
- a number for a timeout
/path/to/file
- used for a file, if theCID
is a file headers:X-Timer
-String
- a number for a timeout
method: POST
- return a body
hostname:
_
- ignores the hostname, path becomes the query path:/path/to/dir/or/file
- it can be any path including/
, this path is the query that will be used with ipfs headers:X-Opt
-String
- options to use for the content, stringified object
method: DELETE
- returns a body
hostname:
_
- ignores the hostname, path becomes the query path:/path/to/dir/or/file
- it can be any path including/
, this path is the query that will be used with ipfs headers:X-Opt
-String
- options to use for the content, stringified object