← Back to Chapters

HTTP 423 Locked

? HTTP 423 Locked

? Quick Overview

The HTTP 423 Locked status code indicates that the requested resource is currently locked and cannot be accessed. This response is commonly used in WebDAV-based systems when a file or resource is locked by another process or user.

? Key Concepts

  • Part of the 4xx Client Error category
  • Indicates a temporary lock on a resource
  • Most commonly associated with WebDAV
  • Client must wait or unlock the resource before retrying

? Syntax / Theory

When a client tries to modify or access a locked resource, the server responds with status code 423. The lock prevents conflicting updates and ensures data integrity.

? Code Example(s)

? View Code Example
// Example: Sending a 423 Locked response in Node.js
res.status(423).send("Resource is locked");

? Live Output / Explanation

Server Response

The server denies access and informs the client that the resource is locked. The client should retry later or release the lock if authorized.

? Interactive Example

? Resource: Available

Try to "Update Document" while the file is locked.

 
? View Logic Code
// Simulated locked resource check
if(resourceLocked){
  throw new Error("423 Locked");
}

? Use Cases

  • Document editing systems
  • Version control platforms
  • Content management systems
  • Collaborative applications

✅ Tips & Best Practices

  • Release locks as soon as possible
  • Provide clear error messages to users
  • Implement retry mechanisms on the client
  • Log lock-related issues for debugging

? Try It Yourself

  • Simulate a locked file in a backend API
  • Handle 423 responses gracefully on the frontend
  • Add retry logic with delays