Hi all,
just for completion of my original mail: I know the "old way" to instantiate
an input stream using a protocol handler (see below). However, this doesn't
work anymore because the nsIHTTPProtocolHandler interface has changed (see
new interface nsIHttpProtocolHandler). So again, the question is how to go
on with the new interfaces to create an input stream object??
// create uri object
var oUrl = Components.classes["@mozilla.org/network/standard-url;1"];
oUrl = oUrl.createInstance(Components.interfaces.nsIURL);
oUrl.spec = http://myhost:port;
var oBody = "arg1=Test&arg2=Test2";
// get io service
oIoService = Components.classes["@mozilla.org/network/io-service;1"];
oIoService = oIoService.getService(Components.interfaces.nsIIOService);
// OLD (!!!) way to get the input stream
oProtocolHandler = oIoService.getProtocolHandler(oUrl.scheme);
oProtocolHandler =
oProtocolHandler.QueryInterface(Components.interfaces.nsIHTTPProtocolHandler
);
var oUploadStream = oProtocolHandler.NewPostDataStream(false, "\r\n" +
oBody, oProtocolHandler.ENCODE_NORMAL);
Thanks, Klaus