Mocking data

A service to simulate and test different HTTP status codes.

Introduction


Uses

Use this mock status code and redirect service to validate how your applications and scripts handle different responses.

Features

  • HTTPS only
  • GET requests only
  • Returns status codes, redirect chains, response headers and response bodies
  • Simulates redirect chains (by setting a specified number of redirects)
  • Support for setting delays for responses (including redirects)
  • Set up multiple custom response headers

NOTE

Please note that this service answers all requests using the HTTP method GET, but in practice this is not representative for some status codes. A server will return specific status codes to a client only under certain conditions such as a particular HTTP method or the presence of specific request headers or their values.

Reference


Use this endpoint to get the response of a specific status code.

GET  https://mock.httpstatus.io

To add a specific status code to the URL, you can simply append it at the end of the URL. For example: https://mock.httpstatus.io/200

Status codes

Use these URLs for the response codes that are supported:

URLs

Status codeMessagePath
200OK/200
201Created/201
202Accepted/202
203Non-Authoritative Information/203
204No Content/204
205Reset Content/205
206Partial Content/206
207Multi-Status/207
208Already Reported/208
226IM Used/226
300Multiple Choices/300
301Moved Permanently/301
302Found/302
303See Other/303
304Not Modified/304
307Temporary Redirect/307
308Permanent Redirect/308
400Bad Request/400
401Unauthorized/401
402Payment Required/402
403Forbidden/403
404Not Found/404
405Method Not Allowed/405
406Not Acceptable/406
407Proxy Authentication Required/407
408Request Timeout/408
409Conflict/409
410Gone/410
411Length Required/411
412Precondition Failed/412
413Payload Too Large/413
414URI Too Long/414
415Unsupported Media Type/415
416Range Not Satisfiable/416
417Expectation Failed/417
418I'm a Teapot/418
421Misdirected Request/421
422Unprocessable Entity/422
423Locked/423
424Failed Dependency/424
425Too Early/425
428Precondition Required/428
429Too Many Requests/429
431Request Header Fields Too Large/431
451Unavailable For Legal Reasons/451
500Internal Server Error/500
501Not Implemented/501
502Bad Gateway/502
503Service Unavailable/503
504Gateway Timeout/504
505HTTP Version Not Supported/505
506Variant Also Negotiates/506
507Insufficient Storage/507
508Loop Detected/508
509Bandwidth Limit Exceeded/509
510Not Extended/510
511Network Authentication Required/511

Redirect chain

Use this URL to create and simulate a redirect chain:

URLs

Status codeMessagePath
307Temporary Redirect/chain

Parameters

Use these params below to delay responses, set the number of simulated redirects in a chain or return custom response headers:

Query

ParameterTypeDefaultDescriptionRequired
delaystring

Set a delay for a response. This parameter also sets a delay for each redirect and the final response in a redirect chain. Should contain a minimum value of 1 and maximum value of 60000 milliseconds.

No
countstring

Defines the number of redirect responses which should be followed by the client. Should contain a minimum value of 1 and a maximum value 25 redirects. Required only for the /chain path.

Yes

Headers

ParameterTypeDefaultDescriptionRequired
acceptstringtext/html

Sends response body as text/html or application/json content type.

No
x-delaystring

Set a delay for a response. This parameter also sets a delay for each redirect but not for the final response in a redirect chain. Should contain a minimum value of 1 and maximum value of 60000 milliseconds.

No
x-responsestring

Set one or more custom response header(s). Use a combination like Foo:Bar where Foo is the header name and Bar is the header value. Setting two or more headers with the same header name will overwrite the previous one. Add a comma between header values to set multiple values for the same header name. Custom headers are not set for responses in the /chain path.

No

Response headers

The endpoint itself returns some fixed response headers that you can use in your scripts or applications to get more insights:

Headers

Header nameDescription
x-response-time

The total server response time including the set delay.

server-timing

Server-timing header that confirms the duration of the delay set using a query or request header param. A response looks like delay;desc="Delay set";dur=1000 where in this example the response was delayed by 1 second.

x-redirect-by

This header identifies which source is responsible for performing a redirect.


Disclaimer


By using this service, you acknowledge that you understand and agree to our Privacy Policy and Terms and Conditions.


Do you have a question about the service?

This website uses cookies to ensure you get the best experience. By using this website, you acknowledge that you understand and agree to our Privacy Policy and Terms and Conditions.