Skip to content

202 Accepted

We got your request and accepted it, but we haven’t finished processing it yet. Often used for long-running background tasks.

Use this when a user submits a job that takes a long time (like ‘generate a massive PDF report’). You return 202 to say ‘Got it, I put it in the background queue’, rather than making them wait for the job to finish.

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