/
400.xml
54 lines (48 loc) · 2.79 KB
/
400.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en" dir="ltr"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:w="tag:fullstack.wiki,2018:ns/"
xmlns:xht="http://www.w3.org/1999/xhtml/vocab#"
>
<head>
<meta charset="UTF-8" />
<title>400 Bad Request</title>
<meta name="description" content="The 400 (Bad Request) HTTP status code indicates a unprocessable request or client error." />
<link rel="up" href="index.xml" />
</head>
<body>
<main about="tag:fullstack.wiki,2018:ns/http/status-codes/400" typeof="w:HTTP-StatusCode">
<a rel="http://www.w3.org/1999/xhtml/vocab#describedby" href="" />
<h1>400 Bad Request</h1>
<p>The 400 (Bad Request) HTTP status code indicates the server cannot fill the request because of an error in the request, as perceived by the server.</p>
<h2>Writing responses (servers)</h2>
<p>Use <code>400 (Bad Request)</code> for errors in the request, where there is not a more specific status code available. Consult the <a href="https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">IANA HTTP Status Code Registry</a> to determine if a more appropriate status code is available. If the error is correctable at the server (for example, an uncaught exception, or a status requiring administrator intervention), then see <a href="500.xml">500 Server Error</a>.</p>
<p>Try to return a short response body that describes the error.</p>
<p>If the error is due to invalid syntax that prevents further parsing, also <a href="../close.xml">close the connection</a>.</p>
<h2>Reading responses (clients)</h2>
<p>400 errors typically cannot be retried without some sort of adjustment. However, without a more specific error code, a user must intervene and troubleshoot the problem with the request.</p>
<h2>Overview table</h2>
<dl class="inline">
<dt>Name</dt>
<dd property="w:HTTP-StatusCode-value">400</dd>
<dt>Message</dt>
<dd property="w:HTTP-StatusCode-line">400 Bad Request</dd>
<dt>Description</dt>
<dd property="w:HTTP-StatusCode-description">The resource does not permit the requested method.</dd>
<dt>Specification</dt>
<dd property="w:specification"><a href="https://httpwg.org/specs/rfc7231.html#status.400">RFC 7231: HTTP/1.1 Semantics and Content §6.5.5. 400 Bad Request</a></dd>
</dl>
<h2>Implementations</h2>
<h3>Node.js (http/https)</h3>
<p>Node.js automatically returns <code>400 Bad Request</code> in the following circumstances:</p>
<ul>
<li>Malformed HTTP request (<a href="https://github.com/nodejs/node/commit/f2f391e575">as of Node.js v9.0.0</a>)</li>
</ul>
<h2>See also</h2>
<ul>
<li><a href="https://evertpot.com/http/400-bad-request">HTTP 400 by Evert Pot</a></li>
<li><a href="https://httpstatusdogs.com/400-bad-request">HTTP 400 on HTTP STATUS DOGS</a></li>
</ul>
</main>
</body>
</html>