200 OK
Fault: Neither
TL;DR
The request was successfully received, understood, and accepted.
The request has succeeded.
What HTTP 200 OK Means
The request has succeeded.
The request was successfully received, understood, and accepted.
Common Causes
- Successful GET request
- Successful POST that doesn't create a resource
- Any successful request
How to Fix It (For Visitors)
- No action needed - request successful
How to Fix It (For Developers/Admins)
- Return 200 for successful operations
- Include response body with requested data
Returning a 200 OK (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 200 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(200).json({ error: 'OK' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='OK'), 200
PHP
<?php
http_response_code(200);
header('Content-Type: application/json');
echo json_encode(['error' => 'OK']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 200 OK
Frequently Asked Questions
What does HTTP 200 OK mean?
The request was successfully received, understood, and accepted. In short: The request has succeeded.
How should I handle an HTTP 200 OK response?
Return 200 for successful operations. Include response body with requested data.
Official Specification
The 200 OK status code is defined in RFC 7231 Section 6.3.1.