What Is a 423 Status Code?
The source or destination resource of a method is locked.
This response SHOULD contain an appropriate precondition or postcondition code, such as ‘lock-token-submitted’ or ‘no-conflicting-lock’.
- Source: RFC4918 Section 11.3
423 CODE REFERENCES
Rails HTTP Status Symbol :locked
Symfony HTTP Status Constant Response::HTTP_LOCKED
.NET HttpStatusCode.Locked
Rust http::StatusCode::LOCKED
Go http.StatusLocked
Python3.5+ http.HTTPStatus.LOCKED
Apache HttpComponents Core org.apache.hc.core5.http.HttpStatus.SC_LOCKED
Angular @angular/common/http/HttpStatusCode.Locked
423 status code example
Request
GET /example-resource HTTP/1.1
Host: www.example.com
Response
HTTP/1.1 423 Locked
Content-Type: text/html
Retry-After: 120
Lock-Token: <opaquelocktoken:1234>
<!DOCTYPE html>
<html>
<head>
<title>Resource Locked</title>
</head>
<body>
<h1>423 Locked</h1>
<p>The resource you are trying to access is currently locked and unavailable.</p>
</body>
</html>
In this example, the server has responded with a 423 status code, indicating that the requested resource is currently locked and unavailable. The response includes a Retry-After
header indicating that the client should wait for 120 seconds before trying again, and a Lock-Token
header that contains an opaque token representing the lock.
To unlock the resource, the client can issue a LOCK
request with the same Lock-Token
header value:
Request
LOCK /example-resource HTTP/1.1
Host: www.example.com
Lock-Token: <opaquelocktoken:1234>
If: <etag-of-the-locked-resource>
Response
HTTP/1.1 200 OK
In this example, the client issues a LOCK
request with the same Lock-Token
header value returned in the previous response, along with an If
header containing the ETag of the locked resource. The server responds with a 200 OK status code, indicating that the resource is now unlocked and available for access.
What causes a 423 status code?
A few scenarios can cause a 423 status code, including:
- A user is trying to edit a document that someone else is already working on
- A website is undergoing maintenance, and the content is temporarily unavailable
- A website has detected suspicious activity on the account and has locked it down for security reasons
How to troubleshoot a 423 status code
If you encounter a 423 status code, there are a few things you can do to troubleshoot the issue:
- Wait for the lock to be released: If the lock is temporary, it will be released automatically after a set amount of time.
- Check with the website or application owner: They may be able to provide more information about the lock and when it will be released.
- Try accessing the resource from a different device or network: There may be an issue with your current device or network that is causing the lock.
How to prevent a 423 status code
There are a few best practices you can follow to avoid a 423 status code:
- Avoid editing the same document or resource simultaneously: If possible, work on separate copies or use version control software.
- Keep your website or application up to date with the latest security patches: This can help prevent unauthorized access and suspicious activity that may trigger a lock.
- Use robust authentication and authorization mechanisms: This can help prevent unauthorized access to resources and reduce the likelihood of locks being triggered.
Additional resources
- Learn about web development
- Learn about SEO
- Web development services from WebFX
- SEO services from WebFX
- MDN Web Docs
- W3Schools
Marketing Tips for Niche Industries
- Tourism & Hospitality Statistics
- Travel and Tourism Marketing Budget
- Urgent Care Marketing Ideas: 5 High-ROI Tactics
- WebFX: Your Education Digital Marketing Agency
- Why Auto Part Retailers Need Digital Marketing
- Why Digital Marketing is Essential for Auctioneers
- Your Guide to Digital Marketing for Exercise Equipment Companies
- Your Guide to Digital Marketing for Industrial Repair Companies
- Vision Care Industry Statistics
- 6 Best Heavy Equipment Marketing Agencies