Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2016년 11월.
참고 : This feature is available in Web Workers, except for Service Workers.
XMLHttpRequest의 responseType 속성은 응답에 포함된 데이터의 유형을 지정하는 열거형 문자열 값입니다.
또한 작성자가 응답 유형을 변경할 수 있습니다. responseType 값이 빈 문자열로 지정되면 기본값인 text가 사용됩니다.
응답에 포함된 데이터의 유형을 지정하는 문자열로, 다음과 같은 값을 가질 수 있습니다.
참고 : 특정 값으로 responseType을 설정할 때, 작성자는 서버가 해당 형식과 호환되는 응답을 실제로 보내는지 확인해야 합니다. 서버가 설정된 responseType과 호환되지 않는 데이터를 반환하면 response의 값은 null이 됩니다.
Worker가 아닌 동기적 모드의 XMLHttpRequest에서 responseType 값을 변경하려는 시도가 있었습니다. 자세한 내용은 아래의 XHR 동기 제한를 참조하세요.
Worker에 속한 요청이 아닌 경우, 동기 XMLHttpRequest에서 responseType 값을 변경할 수 없습니다. 이러한 제한은 브라우저의 메인 스레드를 차단해 사용자 경험을 저하시키는 대규모 동기 작업에 사용되지 않도록 하기 위한 설계입니다.
XHR 요청은 기본적으로 비동기입니다. open()을 호출할 때 선택적 async 매개변수에 false를 전달하면 동기 모드로 설정됩니다.
responseType 값을 document로 설정하려는 시도는 Worker 내에서는 무시됩니다.
| XMLHttpRequest # the-responsetype-attribute |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 8월 23일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.