I had the same issue earlier today. It seems like the example is out of date. It's no longer called soup_session_new
, the reference is now soup_session_sync_new
. Use new Soup.SessionSync ()
and it should work.
Here's a working example:
using Soup;
int main (string[] args) {
string url = "http://google.com";
stdout.printf ("Getting data from %s\n", url);
var session = new Soup.SessionSync ();
var message = new Soup.Message ("GET", url);
session.send_message (message);
stdout.write (message.response_body.data);
return 0;
}