← Back to Home

Delayed Response

/delay/:n
Returns a delayed response after n seconds. Useful for testing timeouts and async behavior. Maximum delay is 10 seconds.

Parameters

n path
Number of seconds to delay (max 10)

Examples

curl
# Delay for 3 seconds
curl https://tcpdata.com/delay/3
JavaScript (fetch)
// Test with 2 second delay
fetch('https://tcpdata.com/delay/2')
  .then(res => res.json())
  .then(data => console.log('Received after delay:', data));
Python (requests)
import requests
import time

start = time.time()
response = requests.get('https://tcpdata.com/delay/3')
elapsed = time.time() - start
print(f'Took {elapsed:.2f} seconds')