Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

前端 未结 7 1213
夕颜
夕颜 2020-11-21 06:46

I\'ve seen a couple questions around here like How to debug RESTful services, which mentions:

Unfortunately that same browser won\'t allow me to test

7条回答
  •  暖寄归人
    2020-11-21 07:19

    I believe those comments refer specifically to the browsers, i.e., clicking links and submitting forms, not XMLHttpRequest. XMLHttpRequest is just a custom client that you wrote in JavaScript that uses the browser as a runtime.

    UPDATE: To clarify, I did not mean (though I did write) that you wrote XMLHttpRequest; I meant that you wrote the code that uses XMLHttpRequest. The browsers do not natively support XMLHttpRequest. XMLHttpRequest comes from the JavaScript runtime, which may be hosted by a browser, although it isn't required to be (see Rhino). That's why people say browsers don't support PUT and DELETE—because it's actually JavaScript that is supporting them.

提交回复
热议问题