Hi

Thanks for the help. I´ve almost gotten it working but there´s a
problem with the postdata.

Here´s my code:

       s = "key=long string with carriagereturns and line feeds,
similar to what
              one might find in a textarea tag";
        var obj, iface, postdata

        obj   = Components.classes["@mozilla.org/io/string-input-stream;1"];
        iface = Components.interfaces.nsIStringInputStream;

        postdata = obj.createInstance(iface);
        postdata.setData(s, s.length);


        try
        {
                var nav = getWebNavigation();
                nav.loadURI("http://foobar.com";, 0, null, postdata, null);
        }
        catch(e)
        {
                alert(e);
        }

With this i get a message "missing colon in request header field" and
it shows just the first line of data like the linefeed cut off the
rest. I thought I should url encode it so I tried to use:

s = escape(s)

which is supposed to do that but then the browser just hangs when
trying to connect to foobar.com and never reaches the destination page.

Any pointers for a newbie ?

thanks,
einar

_______________________________________________
Mozilla-netlib mailing list
Mozilla-netlib@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to