205 Reset Content
Success, and please clear the form you just submitted. Like 204, it returns no body.
When and Why to Use It
Section titled “When and Why to Use It”Use this when you want to tell the client’s browser to clear the form they just submitted. Like 204, you don’t send a body back.
Usage Examples
Section titled “Usage Examples”import { HttpCode, get } from 'shokupan';
export const getResource = get('/resource', () => { return { message: 'Reset Content' };}).pipe(HttpCode(205));import { Controller, Get, HttpCode } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') @HttpCode(205) getResource() { return { message: 'Reset Content' }; }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(205).json({ message: 'Reset Content' });});import { Controller, Get, HttpCode } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') @HttpCode(205) getResource() { return { message: 'Reset Content' }; }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 205; ctx.body = { message: 'Reset Content' }; }});