226 IM Used
The server fulfilled a GET request and applied requested modifications (‘Instance Manipulations’) to the resource.
When and Why to Use It
Section titled “When and Why to Use It”Extremely rare. Used when the server returns a ‘delta’ or diff representing changes to a resource, instead of the whole resource.
Usage Examples
Section titled “Usage Examples”import { HttpCode, get } from 'shokupan';
export const getResource = get('/resource', () => { return { message: 'IM Used' };}).pipe(HttpCode(226));import { Controller, Get, HttpCode } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') @HttpCode(226) getResource() { return { message: 'IM Used' }; }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(226).json({ message: 'IM Used' });});import { Controller, Get, HttpCode } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') @HttpCode(226) getResource() { return { message: 'IM Used' }; }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 226; ctx.body = { message: 'IM Used' }; }});