使用“http-on-modify-request”和“http-on-examine-response”时如何将响应映射到请求?

2024-03-24

使用 HTTP 观察器时如何将传入响应映射到传出请求:https://developer.mozilla.org/en/Setting_HTTP_request_headers#Observers https://developer.mozilla.org/en/Setting_HTTP_request_headers#Observers ?


比较 nsIHttpChannel 对象,例如HttpFox http://code.google.com/p/httpfox/source/browse/trunk/components/HttpFoxService.js does:

getPendingRequestForRequestEvent: function(request) {
   // check for matching request
   for (var i = 0; i < this.Requests.length; i++) {
      if (request.HttpChannel === this.Requests[i].HttpChannel) {
         return i;
      }
   }

   // no match found
   return -1;
},
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用“http-on-modify-request”和“http-on-examine-response”时如何将响应映射到请求? 的相关文章

随机推荐