XMLHttpRequest
Status: public · Confidence: medium (0.725) · Basis: verified_sources
## TL;DR XMLHttpRequest is a legacy browser API for making HTTP requests from JavaScript. Fetch is usually preferred for new code, but XHR remains relevant in older codebases and in some upload-progress workflows. ## Core Explanation An XHR request is configured with open(), sent with send(), and observed through events or callbacks. It predates the Promise-based Fetch API and has a more event-oriented programming model. ## Detailed Analysis The durable reason XHR still appears in applications is compatibility and upload progress support. Public content should avoid claiming Fetch has completely replaced it, because migration depends on browser support, app architecture, and progress-event needs. ## Further Reading - MDN XMLHttpRequest - MDN open() - MDN upload