Web

Do Browsers Support PUT DELETE HEAD via XMLHttpRequest?

Modern browsers like Chrome, Firefox, Safari, Edge fully support HTTP PUT, DELETE, HEAD via XMLHttpRequest (XHR). Debunk myths, check compatibility, CORS limits, and JS examples for REST APIs.

1 answer 1 view

Do modern web browsers support HTTP methods like PUT, DELETE, HEAD, and others via XMLHttpRequest?

Some sources claim browsers only support GET and POST, but tests in Firefox show PUT and DELETE requests completing successfully and appearing correctly in server logs. What are the cross-browser compatibility details for major browsers (Chrome, Safari, Edge, Firefox) and any known limitations?

Yes, modern web browsers fully support HTTP methods like PUT, DELETE, HEAD, OPTIONS, PATCH, and more via XMLHttpRequest (XHR). This holds true across Chrome, Firefox, Safari, and Edge, with your Firefox tests matching what developers see in production—requests hit servers correctly, showing up in logs without issues. The old myth that browsers only handle GET and POST stems from HTML forms, not XHR, which has offered full method support for years.


Contents


Do Modern Browsers Support HTTP PUT, DELETE, and HEAD via XMLHttpRequest?

Short answer: absolutely. If your Firefox tests showed PUT and DELETE requests firing off and landing in server logs just fine, that’s no fluke. XHR—the workhorse behind js xmlhttprequest calls—has backed these methods since the early 2010s, across all major browsers.

The WHATWG XMLHttpRequest spec lays it out clearly: browsers must handle standard HTTP verbs like PUT, DELETE, HEAD, OPTIONS, PATCH, and even TRACE (though that’s rare). No restrictions to just GET and POST. Your server seeing those requests? That’s the proof—browsers send them verbatim.

Why does this matter for developers today? REST APIs demand these methods for proper CRUD operations. Skip them, and you’re stuck tunneling DELETEs through POST with query params, which is messy and non-standard. But with XHR, it’s native. Fire up Chrome DevTools Network tab, run a PUT via new XMLHttpRequest, and watch it go.


XMLHttpRequest HTTP Methods: Full Support for PUT, DELETE, PATCH, and More

Under the hood, XMLHttpRequest shines here. The open() method on MDN takes any valid HTTP method as its first argument. Case-insensitive, too—xhr.open('put', url) works the same as 'PUT'.

Here’s the lineup browsers support via XHR:

  • GET: Fetch data, idempotent.
  • POST: Create/submit, can have body.
  • PUT: Full resource replace, idempotent.
  • DELETE: Remove resource, idempotent.
  • HEAD: Like GET, but no body—great for metadata.
  • OPTIONS: Preflight checks, CORS handshakes.
  • PATCH: Partial updates.
  • Even CONNECT or TRACE, though servers often block them for security.

MDN’s XMLHttpRequest docs confirm: “Supports all standard HTTP methods.” No browser locks you to basics. And unlike forms, XHR sends exactly what you specify—no auto-upgrading to POST.

Quick test? Open console in any tab:

javascript
const xhr = new XMLHttpRequest();
xhr.open('DELETE', 'https://httpbin.org/delete'); // Or your endpoint
xhr.send();

Check Network tab. Boom—DELETE request, 200 OK if server plays nice.


Cross-Browser Compatibility: Chrome, Firefox, Safari, Edge Details

No fragmentation headaches. Modern versions (post-2015) nail XMLHttpRequest support for http put, http delete, and beyond. Pulled from CanIUse XHR2 and MDN API support, here’s the breakdown:

Browser Full PUT/DELETE/HEAD Support Notes
Chrome v1+ (full since v50, 2016) xmlhttprequest chrome flawless; DevTools shows methods perfectly.
Firefox v1+ (full since v47) Your tests confirm—xhr request aborted by browser? Rare, usually CORS.
Safari v3.1+ (full since 11.1, 2018) Handles PATCH too; iOS Safari matches desktop.
Edge v12+ (full since 79, Chromium) Legacy Edge (pre-79) partial; now identical to Chrome.

Global usage: 99%+ coverage as of 2026. IE11? Spotty—PUT/DELETE often downgraded—but who’s on IE11 anymore? Service Workers can intercept these too, but stick to XHR or Fetch for basics.

Edge case: Super old Android browsers (pre-4.4) might balk, but that’s <0.1% traffic.


Common Limitations: CORS Preflights, Security Restrictions, and Errors

Support’s there, but hurdles exist. Biggest? xmlhttprequest cors. PUT and DELETE trigger preflights (OPTIONS requests) because they’re non-simple methods (not just GET/POST with safe headers).

Server must respond with:

Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Access-Control-Allow-Headers: Content-Type

Miss that? XHR status 0, “aborted,” or failed to execute ‘send’ on XMLHttpRequest. You’ve seen it—access to xmlhttprequest blocked.

Other gotchas:

  • Forbidden methods: Browsers block CONNECT, TRACE, TRACK per spec—security.
  • Localhost quirks: xmlhttprequest localhost works, but CORS still applies cross-origin.
  • Body on DELETE: Allowed, but some servers ignore it.
  • Credentials: withCredentials=true needs Access-Control-Allow-Credentials: true.

http patch vs put? Both supported, but PATCH always preflights.

Pro tip: Test with httpbin.org—it echoes methods/headers perfectly.


HTTP PUT vs POST, DELETE Request Examples in JavaScript XHR

Time for code. http put vs post? PUT’s idempotent (repeatable), replaces fully; POST creates new.

PUT example:

javascript
const xhr = new XMLHttpRequest();
xhr.open('PUT', 'https://httpbin.org/put', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
 if (xhr.readyState === 4 && xhr.status === 200) {
 console.log('Updated:', xhr.responseText); // **xmlhttprequest headers** echoed
 }
};
xhr.send(JSON.stringify({ id: 1, name: 'Updated' }));

DELETE (your Firefox win):

javascript
const xhr = new XMLHttpRequest();
xhr.open('DELETE', '/api/users/123'); // **http delete request**
xhr.send(); // No body needed

HEAD for checks:

javascript
xhr.open('HEAD', '/api/resource');
xhr.send();
console.log('ETag:', xhr.getResponseHeader('ETag'));

http get post put delete all-in-one? Loop 'em. Handles xhr post, xmlhttprequest send seamlessly. Errors? Check xhr.status—0 often means CORS.


Historical Myths: Why People Think Browsers Only Support GET/POST

Ever heard “browsers don’t do PUT/DELETE”? Blame HTML forms. They only send GET/POST—spec limitation since 1999. Stack Overflow threads from 2009 nailed it: forms vs XHR.

Back then, IE quirks (methods uppercased oddly) fueled doubt, per Anne van Kesteren’s 2007 post. But XHR? Always full-featured. Another SO confirmation: “Works everywhere now, been doing REST for years.”

http методы get post put delete searches spike in RU dev circles—same myth. Reality: XHR liberated us.


Best Practices and Troubleshooting XHR Errors

Stick to Fetch for new code—cleaner promises. But XHR’s fine for legacy.

Tips:

  • Always set xhr.timeout = 5000;—avoids hangs.
  • xmlhttprequest open first, then headers, then send.
  • Chrome? F12 > Network > filter by method.
  • xhr error? onerror handler: console.error('Failed:', xhr.statusText);
  • Local dev: Use mode: 'cors' or proxy.

New XMLHttpRequest boilerplate? Wrap in function. Scales great.


Sources

  1. XMLHttpRequest — Core API docs confirming full HTTP method support: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest
  2. XMLHttpRequest/open — Method details for specifying PUT, DELETE, etc.: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open
  3. XHR Standard — WHATWG spec on supported HTTP methods and restrictions: https://xhr.spec.whatwg.org/
  4. XHR2 — Cross-browser support data for advanced XHR features: https://caniuse.com/xhr2
  5. MDN-API XMLHttpRequest — Detailed browser compatibility matrix: https://caniuse.com/mdn-api_xmlhttprequest
  6. Are PUT/DELETE/HEAD available in browsers? — Stack Overflow discussion debunking form myths: https://stackoverflow.com/questions/165779/are-the-put-delete-head-etc-methods-available-in-most-web-browsers
  7. DELETE and PUT work on all browsers now — Production confirmation of method support: https://stackoverflow.com/questions/660779/delete-and-put-http-verbs-work-on-all-browsers-now
  8. HTTP method support — Historical browser behavior analysis: https://annevankesteren.nl/2007/10/http-method-support

Conclusion

Modern browsers like Chrome, Firefox, Safari, and Edge deliver rock-solid XMLHttpRequest support for http put, http delete, HEAD, and the full suite—no myths needed. Watch for CORS preflights on non-simple methods, set proper server headers, and you’re golden. Ditch the GET/POST-only hacks; test in your browser today, and build cleaner REST clients. For cutting-edge work, consider Fetch, but XHR’s still a champ.

Authors
Verified by moderation
NeuroAnswers
Moderation
Do Browsers Support PUT DELETE HEAD via XMLHttpRequest?