TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Reads a binary body and returns its size, hashes and detected type

POSThttps://api.testingapis.com/api/bodies/binarySign in to see this endpoint's URL

Accepts application/octet-stream, application/pdf, application/zip, image/png, image/jpeg and image/gif, up to 10MB.

Request body

Optional. application/octet-stream. Raw bytes; returns size, hashes and detected type.

Example body
<raw bytes>

Responses

200
Size, SHA-256, MD5, first 16 bytes and the type detected from magic bytes.
413
Body larger than 10MB.
415
Any other Content-Type.

Example

Request
curl -X POST "https://api.testingapis.com/api/bodies/binary" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @file.bin \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
{
  "contentType": "application/octet-stream",
  "size": 8,
  "sha256": "4c4b6a3be1314ab86138bef4314dde022e600960d8689a2c8f8631802d20dab6",
  "md5": "e9dd2797018cad79186e03e8c5aec8dc",
  "first16BytesHex": "89504E470D0A1A0A",
  "detectedType": "image/png"
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.