웹 개발 및 HTTP 통신을 위한 MIME(Multipurpose Internet Mail Extensions) 유형의 완전한 참조.
text/html.html.htmtext/css.csstext/javascript.js.mjstext/plain.txttext/csv.csvtext/xml.xmltext/markdown.md.markdowntext/calendar.icstext/tab-separated-values.tsvtext/vcard.vcf.vcardimage/jpeg.jpg.jpegimage/png.pngimage/gif.gifimage/webp.webpimage/svg+xml.svg.svgzimage/avif.avifimage/bmp.bmpimage/tiff.tif.tiffimage/ico.icoimage/x-icon.icoimage/heic.heicimage/apng.apngaudio/mpeg.mp3audio/ogg.oga.oggaudio/wav.wavaudio/webm.webaaudio/flac.flacaudio/aac.aacaudio/midi.mid.midiaudio/opus.opusaudio/mp4.m4avideo/mp4.mp4.m4vvideo/webm.webmvideo/ogg.ogvvideo/mpeg.mpeg.mpgvideo/quicktime.mov.qtvideo/x-msvideo.avivideo/3gpp.3gpvideo/x-matroska.mkvvideo/x-ms-wmv.wmvapplication/json.jsonapplication/ld+json.jsonldapplication/xml.xmlapplication/pdf.pdfapplication/zip.zipapplication/gzip.gzapplication/x-tar.tarapplication/x-7z-compressed.7zapplication/x-rar-compressed.rarapplication/javascript.jsapplication/ecmascript.esapplication/typescript.tsapplication/wasm.wasmapplication/octet-stream.*application/x-www-form-urlencoded-multipart/form-data-application/graphql.graphqlapplication/sql.sqlapplication/x-sh.shapplication/x-python-code.pycapplication/msword.docapplication/vnd.openxmlformats-officedocument.wordprocessingml.document.docxapplication/vnd.ms-excel.xlsapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsxapplication/vnd.ms-powerpoint.pptapplication/vnd.openxmlformats-officedocument.presentationml.presentation.pptxapplication/vnd.oasis.opendocument.text.odtapplication/vnd.oasis.opendocument.spreadsheet.odsapplication/vnd.oasis.opendocument.presentation.odpfont/ttf.ttffont/otf.otffont/woff.wofffont/woff2.woff2font/collection.ttcmultipart/mixed-multipart/alternative-multipart/related-message/rfc822.eml.mhtmessage/partial-application/json.jsonREST API responses, config files
text/html.htmlWeb pages served by browsers
text/css.cssStylesheets for web pages
text/javascript.jsJavaScript files (IANA official)
multipart/form-dataFile uploads in HTML forms
application/pdf.pdfDocument downloads & previews
image/webp.webpModern web images (best compression)
application/octet-stream.*Generic binary / force download
application/wasm.wasmWebAssembly modules
MIME 유형은 HTTP 응답의 Content-Type 헤더에 나타나며 브라우저와 클라이언트가 콘텐츠를 처리하는 방법을 이해할 수 있게 합니다.
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 1024
{"status": "ok"}
# File upload request:
Content-Type: multipart/form-data; boundary=----FormBoundary123
# Force browser download:
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="report.xlsx"MIME(Multipurpose Internet Mail Extensions) 유형은 문서, 파일 또는 바이트 모음의 성격과 형식을 나타내는 데 사용되는 표준 식별자입니다. 유형과 하위 유형으로 구성됩니다(예: 'text/html' 또는 'application/json'). 서버와 브라우저는 MIME 유형을 사용하여 파일을 처리하는 방법을 결정합니다.
Content-Type HTTP 헤더를 적절한 MIME 유형으로 설정합니다. 예: Content-Type: application/json; charset=utf-8. Apache 및 Nginx와 같은 웹 서버는 파일 확장자를 MIME 유형에 자동으로 매핑할 수 있습니다. Express.js에서는 res.type('json') 또는 res.setHeader('Content-Type', 'application/json')을 사용합니다.
application/json은 JSON 데이터의 공식 IANA 등록 MIME 유형이며 항상 사용해야 합니다. text/json은 비표준이며 역사적으로 사용되었습니다. 최신 API, 프레임워크 및 브라우저는 모두 JSON 페이로드에 application/json을 기대합니다.
브라우저가 파일을 표시하는 대신 다운로드하도록 강제하는 일반 이진 다운로드 유형으로 application/octet-stream을 사용합니다. 특정 형식에는 적절한 유형을 사용합니다(예: PDF에는 application/pdf). 다운로드 대화 상자를 위해 Content-Disposition: attachment; filename='file.ext'와 결합합니다.