views:

200

answers:

4

What are the advantages and disadvantaghes of using libcurl and libsoup? Which one is better to use for a HTTP operation where I have to send request to a server to get a response, and has a quick reaction time?

TIA, Praveen

+1  A: 

http://curl.haxx.se/libcurl/libsoup.html

Your probably better off sticking with libcurl if you want portability and stability.

DRL
+1  A: 

I was looking at libsoup to implement the server side of an API on a hobby project (I was making my own router).

By the time I got through satisfying the GNOME dependencies, the simplicity of the callback based server side code didn't seem as attractive as it once did. The interface is nice enough, see soup_server_add_handler().

If you write GNOME applications (thus can already count on the GNOME dependencies being there), its ok (it felt sluggish, to me).

If you are just writing client code, or anything that has to work in the absence of GNOME, stick to curl.

Tim Post
It's worth adding that libcurl also can be used in Gnome applications (using `glibcurl` wrapper).
el.pescado
+1  A: 

Libsoup is coming along, but libcurl has much better support and stability. Lib soup devs readily admit that you should probably be using libcurl.

The 4th item is especially important because even on Linux KDE and XCF users will install gnome-related libs, but it isn't nice to force them to use the gnome libraries when a platform independent option is available.

1. libcurl is (far) more portable
2. libsoup lacks support for: NTLM for proxies (Proxy-Authentication:), GSS, trailers in chunked responses, OpenSSL
3. libsoup offers server-side support
4. libsoup is using GNOME-related libs, making it a less convenient choice for non-GNOME environments. 

"I found that libsoup is far slower than libcurl. It uses at least 4x the amount of CPU to transfer a high-bitrate datastream over HTTP. I attribute this to the over-reliance on heavy-weight glib/gobject constructs. Man, that stuff is slow and a pain to use!" - Matt Gruenke

Aaron Harun
A: 

How about caching ? libcurl doesn't support it. I'm currently porting our app to gcc (OSX) and wonder what I should be using. Caching is important in our case...

Pitoneux