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: packages/kit/src/exports/index.js
+8
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,14 @@ export function isHttpError(e, status) {
84
84
/**
85
85
* Redirect a request. When called during request handling, SvelteKit will return a redirect response.
86
86
* Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it.
87
+
*
88
+
* Most common status codes:
89
+
* * `303 See Other`: redirect as a GET request (often used after a form POST request)
90
+
* * `307 Temporary Redirect`: redirect will keep the request method
91
+
* * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page
92
+
*
93
+
* [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages)
94
+
*
87
95
* @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number)} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308.
88
96
* @param {string | URL} location The location to redirect to.
89
97
* @throws {Redirect} This error instructs SvelteKit to redirect to the specified location.
0 commit comments