505 HTTP Version Not Supported
The server does not support the HTTP protocol version you are trying to use.
When and Why to Use It
Section titled “When and Why to Use It”Extremely rare. Throw this if your server strictly requires HTTP/2 or HTTP/3, and a client tries to connect with HTTP/1.0.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('HTTP Version Not Supported', 505);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('HTTP Version Not Supported', 505); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(505).json({ error: 'HTTP Version Not Supported' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('HTTP Version Not Supported', 505); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 505; ctx.body = { error: 'HTTP Version Not Supported' }; }});