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
Copy file name to clipboardExpand all lines: v2/core-concepts/the-protocol.mdx
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,16 @@ The following headers are automatically sent by Inertia when making requests. Yo
147
147
Comma-separated list of non-expired [once prop](/v2/data-props/once-props) keys already loaded on the client. The server will skip resolving these props unless explicitly requested via a partial reload or force refreshed server-side.
148
148
</ParamField>
149
149
150
+
The following headers are used for [Precognition](/v2/the-basics/forms#precognition) validation requests.
151
+
152
+
<ParamFieldheader="Precognition"type="boolean">
153
+
Set to `true` to indicate this is a Precognition validation request.
The following headers should be sent by your server-side adapter in Inertia responses. If you're using an official server-side adapter, these are handled automatically.
@@ -163,6 +173,20 @@ The following headers should be sent by your server-side adapter in Inertia resp
163
173
Set to `X-Inertia` to help browsers correctly differentiate between HTML and JSON responses.
164
174
</ParamField>
165
175
176
+
The following headers are used for [Precognition](/v2/the-basics/forms#precognition) validation responses.
177
+
178
+
<ParamFieldheader="Precognition"type="string">
179
+
Set to `true` to indicate this is a Precognition validation response.
Set to `true` when validation passes with no errors, combined with a `204 No Content` status code.
184
+
</ParamField>
185
+
186
+
<ParamFieldheader="Vary"type="string">
187
+
Set to `Precognition` on all responses when the Precognition middleware is applied.
188
+
</ParamField>
189
+
166
190
## The Page Object
167
191
168
192
Inertia shares data between the server and client via a page object. This object includes the necessary information required to render the page component, update the browser's history state, and track the site's asset version. The page object can include the following properties:
@@ -522,3 +546,10 @@ Inertia uses specific HTTP status codes to handle different scenarios.
522
546
|**302 Found**| Standard redirect response. Inertia's server-side adapters automatically convert this to `303 See Other` when returned after `PUT`, `PATCH`, or `DELETE` requests. |
523
547
|**303 See Other**| Used for redirects after non-GET requests. This status code tells the browser to make a `GET` request to the redirect URL, preventing duplicate form submissions that could occur if the browser repeated the original request method. |
524
548
|**409 Conflict**| Returned when there's an asset version mismatch or for external redirects. For asset mismatches, this prompts a full page reload. For external redirects, the response includes an `X-Inertia-Location` header and triggers a `window.location` redirect client-side. |
549
+
550
+
The following status codes are used for [Precognition](/v2/the-basics/forms#precognition) validation requests.
0 commit comments