{
  "id": "23426e9d0a96a5444a7f0951",
  "source": "http",
  "type": "go-function",
  "title": "http.func DetectContentType ¶",
  "content": "# http.func DetectContentType ¶\n\n```\nfunc DetectContentType(data []byte) string\n```\n\nDetectContentType implements the algorithm described\nat https://mimesniff.spec.whatwg.org/ to determine the\nContent-Type of the given data. It considers at most the\nfirst 512 bytes of data. DetectContentType always returns\na valid MIME type: if it cannot determine a more specific one, it\nreturns \"application/octet-stream\".",
  "url": "https://pkg.go.dev/http#func DetectContentType ¶",
  "metadata": {
    "examples": "null",
    "import_path": "Standard library/net/http",
    "kind": "function",
    "package": "http",
    "signature": "func DetectContentType(data []byte) string",
    "symbol": "func DetectContentType ¶"
  },
  "hash": "73dce1ebbfa64132571a04d319d15aca387bc1d958f57cabb698395253920d02",
  "timestamp": "2026-02-19T12:17:17.237470527+01:00"
}