414 URI Too Long
The URL query string is way too long for the server to process.
When and Why to Use It
Section titled “When and Why to Use It”Use this when the URL query string is absurdly long, which could be a sign of a bad client loop or a malicious attack trying to crash your router.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('URI Too Long', 414);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('URI Too Long', 414); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(414).json({ error: 'URI Too Long' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('URI Too Long', 414); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 414; ctx.body = { error: 'URI Too Long' }; }});