application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.openxmlformats-officedocument.spreadsheetml.sheet means: This registered media type identifies Microsoft Excel .xlsx workbooks in the Office Open XML format. Like .docx, an .xlsx is a ZIP container of XML parts describing sheets, cells, formulas, styles and shared strings, enabling structured spreadsheet interchange. Application media types carry structured or binary data that a program consumes rather than a human reading raw bytes. The subtype tells the receiver exactly which parser, decoder or handler to invoke, so sending the correct Content-Type is part of the API contract: a mismatch makes servers reject the body with 415 Unsupported Media Type or clients mis-parse the payload. You will encounter application/vnd.openxmlformats-officedocument.spreadsheetml.sheet in contexts such as excel workbook downloads and uploads; spreadsheet interchange between office suites and data tools; server-side report generation in xlsx form. It is commonly associated with the file extension(s) .xlsx. Serve the full registered type, not application/zip or the legacy application/vnd.ms-excel (which is .xls). Macro-enabled workbooks use the .xlsm type. Parsing .xlsx requires reading the ZIP and XML parts, not treating it as CSV.
When you'll see application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- Excel workbook downloads and uploads
- Spreadsheet interchange between office suites and data tools
- Server-side report generation in XLSX form
How to handle it
When handling an application type, set the Content-Type header explicitly on every request and response that carries a body, and advertise what you accept with the Accept header. Parse the payload with a library that matches the subtype rather than sniffing bytes, and validate the structure before trusting it. If a server returns 415, the declared type does not match what it expects — compare your header against the API documentation character for character, including parameters such as charset or boundary. As a final checklist for application types: register the exact subtype in your API documentation, validate incoming bodies against a schema before use, set X-Content-Type-Options: nosniff to stop MIME sniffing, and version your media types when the payload contract changes so old clients keep working.
Notes & gotchas
Serve the full registered type, not application/zip or the legacy application/vnd.ms-excel (which is .xls). Macro-enabled workbooks use the .xlsm type. Parsing .xlsx requires reading the ZIP and XML parts, not treating it as CSV.
Examples
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Length: 128
Sample application/vnd.openxmlformats-officedocument.spreadsheetml.sheet content delivered with the correct Content-Type header. curl -i -H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" https://api.example.com/v1/resource # inspect the returned Content-Type const res = await fetch("/v1/resource", { headers: { Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" } });
// verify res.headers.get("Content-Type") starts with "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
const text = await res.text(); // handle according to the declared type import requests
res = requests.get("https://api.example.com/v1/resource",
headers={"Accept": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}, timeout=10)
res.raise_for_status()
# confirm the server declared the expected type
assert res.headers["Content-Type"].startswith("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
text = res.text # decode/handle according to the type Frequently asked questions
What is the MIME type for .xls vs .xlsx?
.xls (legacy binary) uses application/vnd.ms-excel; .xlsx (Office Open XML) uses application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. They are different formats.
Can I convert XLSX to CSV easily?
Yes, but you must parse the ZIP/XML structure or use a library; CSV is a single flat table while XLSX holds multiple sheets, formulas and formatting. Export the desired sheet to text/csv.
What happens if I send the wrong application Content-Type?
Servers that validate media types answer 415 Unsupported Media Type, and clients may parse the body with the wrong decoder. Always set Content-Type to the registered type that matches your payload, and set Accept to the types you can handle.
Is application/octet-stream a safe default?
It means 'arbitrary binary bytes' and forces a download rather than inline handling. Use it only when the real type is unknown or you deliberately want a save-as dialog; otherwise declare the specific registered type.
How do I debug a 415 Unsupported Media Type response?
Compare the Content-Type you actually sent against what the endpoint documents, including parameters like charset and boundary. A 415 means the server refuses that media type; send the exact registered type it accepts and retry.
Try the CSV to JSON
Parse CSV into typed JSON with header and delimiter detection.