You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change incorporates feedback from Adin, Rod and Juan:
- bytes: #402 (review)
- car-scope: #402 (comment)
I really hope these names will be good enough, but I am running on
artisan, recycled electrons so can do this all day :-)
The following query parameters are only available for requests made with either a `format=car`queryparameter or an `Accept: application/vnd.ipld.car` request header. These parameters modify shape of the IPLD graph returned within the car file.
219
+
Only used on CAR requests, same as [dag-scope](/http-gateways/trustless-gateway/#dag-scope-request-query-parameter) from :cite[trustless-gateway]
220
220
221
-
### `car-scope` (request query parameter)
221
+
### `entity-bytes` (request query parameter)
222
222
223
-
Optional, `car-scope=(block|file|all)` with default value 'all', describes the shape of the dag fetched the terminus of the specified path whose blocks are included in the returned CAR file after the blocks required to traverse path segments.
224
-
225
-
`block` - Only the root block at the end of the path is returned After blocks required to verify the specified path segments.
226
-
227
-
`file` - For queries that traverse UnixFS data, `file` roughly means return blocks needed to verify the end of the path as a filesystem entity. In other words, all the blocks needed to 'cat' a UnixFS file at the end of the specified path, or to 'ls' a UnixFS directory at the end of the specified path. For all queries that do not reference non-UnixFS data, `file` is equivalent to `block`
228
-
229
-
`all` - Transmit the entire contiguous DAG that begins at the end of the path query, after blocks required to verify path segments
230
-
231
-
### `bytes` (request query parameter)
232
-
233
-
Optional, `bytes=x:y` with default value `0:*`. When the entity at the end of the specified path can be intepreted as a contingous array of bytes (such as a UnixFS file), returns only the blocks required to verify the specified byte range of said entity. Put another way, the `bytes` parameters can serve as a trustless form of an HTTP range request. If the entity at the end of the path cannot be interpreted as a continguous array of bytes (such as a CBOR/JSON map), this parameter has no effect. Allowed values for `x` and `y` are positive integers where y >= x, which limit the return blocks to needed to satify the range [x, y]. In addition the following additional values are permitted:
234
-
235
-
-`*` can be substituted for end-of-file
236
-
-`?bytes=0:*` is the entire file (i.e. to fulfill HTTP Range Request `x-` requests)
237
-
- Negative numbers can be used for referring to bytes from the end of a file
238
-
-`?bytes=-1024:*` is the last 1024 bytes of a file (i.e. to fulfill HTTP Range Request `-y` requests)
239
-
- It is also permissible (unlike with HTTP Range Requests) to ask for the range of 500 bytes from the beginning of the file to 1000 bytes from the end by `?bytes=499:-1000`
240
-
241
-
<!-- TODO Planned: https://github.com/ipfs/go-ipfs/issues/8769
242
-
- `selector=<cid>` can be used for passing a CID with [IPLD selector](https://ipld.io/specs/selectors)
243
-
- Selector should be in dag-json or dag-cbor format
244
-
- This is a powerful primitive that allows for fetching subsets of data in specific order, either as raw bytes, or a CAR stream. Think “HTTP range requests”, but for IPLD, and more powerful.
245
-
-->
223
+
Only used on CAR requests, same as [entity-bytes](/http-gateways/trustless-gateway/#entity-bytes-request-query-parameter) from :cite[trustless-gateway]
0 commit comments