Mock HTTP

Last updated 2026-05-20

Mock any HTTP status code by visiting /http/{code}. The endpoint returns the right status, an application/problem+json content type for 4xx/5xx, and an optional custom message.

Mock HTTP

  • Visit any code: jsonexamples.com/http/{code}/{optional-message}.
fetch('https://jsonexamples.com/http/200')
  .then(res => res.json())
  .then(console.log);
Response
{
  "status": "200",
  "message": "OK"
}
fetch('https://jsonexamples.com/http/404/Hello_Peter')
  .then(res => res.json())
  .then(console.log);
Response
{
  "status": "404",
  "message": "Hello_Peter"
}

Related examples