Skip to content

307 Temporary Redirect

Like 302, but strictly forces the client to use the exact same HTTP method (e.g., POST) when following the redirect.

Use this instead of 302 when you want to guarantee the client will use the EXACT same HTTP method after redirecting. If they POSTed to the old URL, they must POST to the new URL.

import { HttpCode, get } from 'shokupan';
export const getResource = get('/resource', () => {
return { message: 'Temporary Redirect' };
}).pipe(HttpCode(307));