← Back to Home

Stream Bytes

/stream-bytes/:n
Streams n random bytes.

Parameters

n path
Number of bytes to stream

Examples

curl
curl https://tcpdata.com/stream-bytes/50
JavaScript (fetch)
fetch('https://tcpdata.com/stream-bytes/50')
  .then(res => res.arrayBuffer())
  .then(data => console.log(data.byteLength));
Python (requests)
import requests

response = requests.get('https://tcpdata.com/stream-bytes/50', stream=True)
for chunk in response.iter_content(chunk_size=10):
    print(len(chunk))