[Livehttpheaders] How to get and set request header

rui wang ruiwangwarm at gmail.com
Fri Oct 2 19:04:34 PDT 2009

Hi, all

I am implementing a firefox addon based livehttpheaders. I encounter a
problem when I tried to read the content length of a request, and then
insert a new header field into the request. I found that I can use
oHttp.setRequestHeader to insert a header field, and I can use the class
HeaderInfoVisitor to read a header field. But the issue is I cannot use them
at the same time. Anyone can offer any suggestions? I appreciate a lot.
Following are my codes.
var visitor = new HeaderInfoVisitor(oHttp);    //oHttp is the object with
http request
var request = visitor.visitRequest();
var len = request["Content-Length"];
if (len >= 0) {
        oHttp.setRequestHeader("padding","okay",false); //this will cause a
runtime error

Rui Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mozdev.org/pipermail/livehttpheaders/attachments/20091002/e5779429/attachment.html>

More information about the Livehttpheaders mailing list