Skip to content
v1.0.0

Response statuses

Example of an OpenAPI document with response statuses.

License

MIT

Servers

https://httpstat.us/

Default


ID: get200

Get 200

GET
200

Example of a response with a 200 status code.

Responses

Successful response
application/json
JSON
"200 OK"

Samples

Bruno
get {
  url: https://httpstat.us/200
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://httpstat.us/200
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://httpstat.us/200' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://httpstat.us/200', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://httpstat.us/200';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://httpstat.us/200'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

ID: get201

Get 201

GET
201

Example of a response with a 201 status code.

Responses

Created
application/json
JSON
"201 Created"

Samples

Bruno
get {
  url: https://httpstat.us/201
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://httpstat.us/201
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://httpstat.us/201' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://httpstat.us/201', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://httpstat.us/201';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://httpstat.us/201'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

ID: get400

Get 400

GET
400

Example of a response with a 400 status code.

Responses

Bad Request
application/json
JSON
"400 Bad Request"

Samples

Bruno
get {
  url: https://httpstat.us/400
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://httpstat.us/400
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://httpstat.us/400' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://httpstat.us/400', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://httpstat.us/400';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://httpstat.us/400'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

ID: get401

Get 401

GET
401

Example of a response with a 401 status code.

Responses

Unauthorized
application/json
JSON
"401 Unauthorized"

Samples

Bruno
get {
  url: https://httpstat.us/401
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://httpstat.us/401
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://httpstat.us/401' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://httpstat.us/401', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://httpstat.us/401';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://httpstat.us/401'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

ID: get403

Get 403

GET
403

Example of a response with a 403 status code.

Responses

Forbidden
application/json
JSON
"403 Forbidden"

Samples

Bruno
get {
  url: https://httpstat.us/403
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://httpstat.us/403
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://httpstat.us/403' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://httpstat.us/403', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://httpstat.us/403';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://httpstat.us/403'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

ID: get404

Get 404

GET
404

Example of a response with a 404 status code.

Responses

Not Found
application/json
JSON
"404 Not Found"

Samples

Bruno
get {
  url: https://httpstat.us/404
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://httpstat.us/404
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://httpstat.us/404' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://httpstat.us/404', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://httpstat.us/404';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://httpstat.us/404'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

ID: get500

Get 500

GET
500

Example of a response with a 500 status code.

Responses

Internal Server Error
application/json
JSON
"500 Internal Server Error"

Samples

Bruno
get {
  url: https://httpstat.us/500
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://httpstat.us/500
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://httpstat.us/500' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://httpstat.us/500', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://httpstat.us/500';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://httpstat.us/500'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

Powered by VitePress OpenAPI