Re: Why don't run this code.....?



eldruida wrote:
> char *base = " http://localhost:4080";;

There shouldn't be a space at the start of the string there.

>     msg = soup_message_new("SOUP_METHOD_GET",url_to_get);

And there shouldn't be quotes around SOUP_METHOD_GET. It should either be

     msg = soup_message_new(SOUP_METHOD_GET,url_to_get);
or
     msg = soup_message_new("GET",url_to_get);


Finally, you're using SoupSessionAsync, which does all of its I/O during
the glib/gtk main loop, so you'd need to create a main loop and run that
and wait for the callback to be run (eg, see tests/getbug.c in the
libsoup sources). If you want it to do the HTTP right away and block
while it waits for the response, use SoupSessionSync and
soup_session_send_message() rather than soup_session_queue_message().

-- Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]