let session = new Soup.Session();
const message = Soup.Message.new(‘GET’,‘https://www.example.com’);
let inputStream = session.send_message(message);
let [returnval,bffr] = inputStream.read(null);
and the error I get is,
(gjs:4338): Gjs-CRITICAL **: 10:17:17.987: JS ERROR: TypeError: inputStream.read is not a function @hello.js:42:32
I am using soup 2.0. I am trying to read from a RSS feed. If the response content type is application/xml the soup.session.send(msg, cancellable ) works which returns Gio.Inputstram. But when the response content type is application/rss+xml soup.session.send(msg, cancellable ) doesn’t work. soup.send_message(msg) works with both the cases.
As per the API documentation, the soup.send(msg,cancellable) synchronously sends a message, but returns before reading the response body, and allows you to read the response via Gio.InputStream.
I don’t know the difference between application/xml and application/rss+xml content type.
If the response content type is application/xml the soup.session.send(msg, cancellable ) works which returns Gio.Inputstram. But when the response content type is application/rss+xml soup.session.send(msg, cancellable ) doesn’t work.
That seems unlikely.
If you need further help, consider sharing a .js reproducer I can run with GJS, I will have a look at it.
Yes, you are right it does work. It was my mistake. I couldn’t upload .js file here so, I am just copy pasteing my code.
/********************************************************************************
const {Soup,GLib, Gio} = imports.gi;