← Back to Home

Status Codes

/status/:code
Returns the specified HTTP status code. Useful for testing error handling and status code responses.

Parameters

code path
HTTP status code (e.g., 200, 404, 500)

Examples

curl
# Test 404 Not Found
curl -i https://tcpdata.com/status/404

# Test 500 Internal Server Error
curl -i https://tcpdata.com/status/500

# Test 201 Created
curl -i https://tcpdata.com/status/201
JavaScript (fetch)
fetch('https://tcpdata.com/status/404')
  .then(res => {
    console.log('Status:', res.status);
    console.log('OK:', res.ok);
  });
Python (requests)
import requests

response = requests.get('https://tcpdata.com/status/404')
print(f'Status Code: {response.status_code}')