AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
4xx Client Error
The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource. This is commonly used in version control systems and collaborative editing applications where conflicts arise from concurrent modifications.
When two users simultaneously edit the same document, the second user's save request should include the version they last saw. If the server detects the version is outdated, return 409 Conflict with details about what changed and a link to the latest version so the client can merge.
// Laravel - optimistic locking with 409
$post = Post::findOrFail($id);
if ($request->input('version') !== $post->version) {
return response()->json([
'error' => 'Version conflict',
'latest_version' => $post->version,
'latest_content' => $post->content,
], 409);
}
Mistake: Using 409 for validation errors instead of 422
Fix: Use 409 specifically for conflicts with the current state (e.g., stale version, duplicate). Use 422 for request body validation errors that do not depend on server state.
Mistake: Not providing enough information to resolve the conflict
Fix: A 409 response should include details about what the conflict is and how the client can resolve it, such as the current server state or the specific conflicting fields.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026