This is a list of APIs that have been removed:
Define aliases for property names
You must use the string name of properties directly which works in libsoup 2 already.
SoupSocket has been removed
SoupProxyResolverDefault is replaced by
SoupDate has been replaced by GDateTime
SoupSession:ssl-strict has been removed in favor of using the
soup_session_cancel_message() has been removed
Instead you pass a GCancellable to APIs and call
SoupSession::authenticate signal has been replaced by
SoupMessage::authenticate. It now allows returning
TRUE to signifiy
if you will handle authentication which allows for asynchronous handling.
You can no longer directly access various structs such as SoupMessage. These are now accessed by getters and setters. See below for direct conversions:
|Struct field||Getter/Setter function|
|SoupMessage.response_body||See section on IO|
Similar struct changes exist for SoupCookie but have very straightforward replacements.
The SoupURI type has been replaced with the GUri type which has some implications.
Creating a GUri is generally as simple as
SOUP_HTTP_URI_FLAGS, NULL). You may want to add
G_URI_FLAGS_PARSE_RELAXED to accept input that used to be
Note that unlike SoupURI GUri is an immutable type so you cannot change the contents
of one after it has been constructed. We provide
soup_copy_uri() to aid in modifying them.
The equivalent behavior to
soup_uri_to_string (uri, FALSE) is
g_uri_to_string_partial (uri, G_URI_HIDE_PASSWORD).
Since GUri does not provide any function to check for equality
soup_uri_equal() still exists.
OPTIONS message with a path of
* is no
longer a valid URI and has been replaced with SoupMessage:options-ping.
Previously SoupStatus was used to hold libsoup errors
SOUP_STATUS_IS_TRANSPORT_ERROR()). Now all of these errors are
propagated up through the normal GError method on the various APIs to send messages.
Here is a mapping chart between the status codes and new errors:
Previously there were ways to allow libsoup to read data into buffers and for you to
read from those buffers such as
libsoup no longer stores a buffer of data for you to read from and instead it returns a GInputStream which you read from using normal GIO APIs.
If you want to simply request a buffer and nothing more you can use the
This also applies to writing data where you can set a GOutputStream using
soup_message_set_request_body() or use the convenience API
soup_message_set_request_body_from_bytes() to use a GBytes
In libsoup 2 there was an attempt at making various APIs of the library thread-safe. However this was never well tested, maintained, or documented.
In libsoup 3 it now behaves in line with other GObject libraries. Once you create a SoupSession all usage of that session must happen on the same thread. You may create seperate sessions per thread but in most use-cases you should be using the async APIs which handle non-blocking IO for you.