HTTPError.net

The fastest way to diagnose, understand, and fix any HTTP status code

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

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

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.

View the IANA HTTP Status Code Registry →