499 Client Closed Request
An unofficial Nginx code. The client closed the connection before the server could send a response.
When and Why to Use It
Section titled “When and Why to Use It”Nginx uses this internally in log files to indicate that the client hung up before Nginx could build the response.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('Client Closed Request', 499);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('Client Closed Request', 499); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(499).json({ error: 'Client Closed Request' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('Client Closed Request', 499); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 499; ctx.body = { error: 'Client Closed Request' }; }});