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
* chore: update format and accept docs
updating example to match SHOULD from specs
ipfs/specs#478
* chore: fix lint and broken links
* chore: update links to specs.ipfs.tech website
Copy file name to clipboardExpand all lines: docs/reference/http/gateway.md
+18-19Lines changed: 18 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,14 @@ description: HTTP Gateway API reference for IPFS clients.
5
5
6
6
# HTTP Gateway reference
7
7
8
-
Gateways provide implementation and runtime agnostic HTTP interface for retrieving [content-addressed](../../concepts/glossary/#content-addressing) data from IPFS with regular HTTP clients and libraries.
8
+
Gateways provide implementation and runtime agnostic HTTP interface for retrieving [content-addressed](../../concepts/glossary.md#content-addressing) data from IPFS with regular HTTP clients and libraries.
9
9
10
10
11
11
## API
12
12
13
13
### `GET /ipfs/{cid}[/{path}][?{params}]`
14
14
15
-
-`cid` is a [CID](../../concepts/glossary/#cid), the root identifier of the requested content path
15
+
-`cid` is a [CID](../../concepts/glossary.md#cid), the root identifier of the requested content path
16
16
-`path` – optional path under the root CID
17
17
18
18
Optional query parameters:
@@ -23,7 +23,7 @@ Optional query parameters:
23
23
24
24
::: tip Before you continue
25
25
26
-
Make sure you understand [how to address IPFS on the web](../../how-to/address-ipfs-on-web/) and the differences between [Path Gateways](../../how-to/address-ipfs-on-web/#path-gateway) and [Subdomain Gateways](../../how-to/address-ipfs-on-web/#subdomain-gateway).
26
+
Make sure you understand [how to address IPFS on the web](../../how-to/address-ipfs-on-web.md) and the differences between [Path Gateways](../../how-to/address-ipfs-on-web.md#path-gateway) and [Subdomain Gateways](../../how-to/address-ipfs-on-web.md#subdomain-gateway).
27
27
28
28
:::
29
29
@@ -50,7 +50,7 @@ When fetching a CID directly, one can include a `filename` parameter with file n
50
50
51
51
### Trustless, verifiable retrieval
52
52
53
-
Clients capable of verifying content-addressed data on their own, should use [application/vnd.ipld.raw](https://www.iana.org/assignments/media-types/application/vnd.ipld.raw) and [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) response types (raw [blocks](../../concepts/glossary/#block) and [CARs](../../concepts/glossary/#car)) and always ask for CIDs directly (`/ipfs/{cid}`).
53
+
Clients capable of verifying content-addressed data on their own, should use [application/vnd.ipld.raw](https://www.iana.org/assignments/media-types/application/vnd.ipld.raw) and [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) response types (raw [blocks](../../concepts/glossary.md#block) and [CARs](../../concepts/glossary.md#car)) and always ask for CIDs directly (`/ipfs/{cid}`).
54
54
55
55
::: callout
56
56
@@ -60,28 +60,28 @@ This mode of operation removes the need for trusting gateway returns correct dat
60
60
61
61
#### Example: fetching an entire DAG as a CAR stream from a public gateway
62
62
63
-
Using `Accept` HTTP header with [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) type:
63
+
To request [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) response type:
An alternative is to pass `?format=car` URL parameter:
72
+
A Client SHOULD include the [`format` query parameter](https://specs.ipfs.tech/http-gateways/trustless-gateway/#format-request-query-parameter) in the request URL, ideally in addition to the [`Accept` header](https://specs.ipfs.tech/http-gateways/trustless-gateway/#accept-request-header). This provides the best interoperability and ensures consistent HTTP cache behavior across various gateway implementations.
CAR verification does not require running IPFS node. Clients can leverage standalone tools and libraries such as [ipfs-car](https://www.npmjs.com/package/ipfs-car):
An alternative is to pass `?format=raw` URL parameter:
105
+
A Client SHOULD include the [`format` query parameter](https://specs.ipfs.tech/http-gateways/trustless-gateway/#format-request-query-parameter) in the request URL, ideally in addition to the [`Accept` header](https://specs.ipfs.tech/http-gateways/trustless-gateway/#accept-request-header). This provides the best interoperability and ensures consistent HTTP cache behavior across various gateway implementations.
The HTTP Gateway specification for IPFS implementers is available in [ipfs/specs repository](https://github.com/ipfs/specs/blob/main/http-gateways/#readme).
113
+
The HTTP Gateway specification for IPFS implementers is available at [specs.ipfs.tech](https://specs.ipfs.tech/http-gateways/).
115
114
Below are links for the most useful specifications.
116
115
117
116
118
117
### HTTP
119
118
120
119
These are "low level" gateways that expose IPFS resources over HTTP protocol.
121
120
122
-
*[Path Gateway](https://github.com/ipfs/specs/blob/main/http-gateways/PATH_GATEWAY.md) ← **START HERE**, other types of gateway are specified as a delta against this specification.
123
-
*[Trustless Gateway](https://github.com/ipfs/specs/blob/main/http-gateways/TRUSTLESS_GATEWAY.md) is a subset that returns verifiable response types (raw [blocks](../../concepts/glossary/#block) and [CARs](../../concepts/glossary/#car))
121
+
*[Path Gateway](https://specs.ipfs.tech/http-gateways/path-gateway/) ← **START HERE**, other types of gateway are specified as a delta against this specification.
122
+
*[Trustless Gateway](https://specs.ipfs.tech/http-gateways/trustless-gateway/) is a subset that returns verifiable response types (raw [blocks](../../concepts/glossary.md#block) and [CARs](../../concepts/glossary.md#car))
124
123
125
124
### Web
126
125
127
126
Special types of gateway which leverage `Host` header in addition to URL `pathname`. Designed for website hosting and improved interoperability with web browsers and [origin-based security model](https://en.wikipedia.org/wiki/Same-origin_policy).
0 commit comments