How can I create a XMLHttpRequest wrapper/proxy?

前端 未结 4 1742
面向向阳花
面向向阳花 2020-12-10 16:07

These methods that come to mind, what are the pros and cons of each?

Method 1: Augment native instance

var _XMLHttpRequest = XMLHttpRequest;
XMLHttpR         


        
4条回答
  •  被撕碎了的回忆
    2020-12-10 16:38

    I have tried all 3. I have to intercept calls from within code that I do not manage that already has Boomerang AutoXHR plugin running and intercepting calls. #2 and #3 just resulted in errors but #1 worked perfectly in my strange messed up use-case.

提交回复
热议问题