Session


Object Hierarchy:

Soup.Session Soup.Session Soup.Session GLib.Object GLib.Object GLib.Object->Soup.Session

Description:

[ CCode ( type_id = "soup_session_get_type ()" ) ]
public class Session : Object

Soup session state object.

Session is the object that controls client-side HTTP. A Session encapsulates all of the state that libsoup is keeping on behalf of your program; cached HTTP connections, authentication information, etc. It also keeps track of various global options and features that you are using.

Most applications will only need a single Session; the primary reason you might need multiple sessions is if you need to have multiple independent authentication contexts. (Eg, you are connecting to a server and authenticating as two different users at different times; the easiest way to ensure that each [class@Message] is sent with the authentication information you intended is to use one session for the first user, and a second session for the other user.)

Additional Session functionality is provided by [iface@SessionFeature] objects, which can be added to a session with [[email protected]_feature] or [[email protected]_feature_by_type] For example, [class@Logger] provides support for logging HTTP traffic, [class@ContentDecoder] provides support for compressed response handling, and [class@ContentSniffer] provides support for HTML5-style response body content sniffing. Additionally, subtypes of [class@Auth] can be added as features, to add support for additional authentication types.

All `SoupSession`s are created with a [class@AuthManager], and support for soup_type_auth_basic and soup_type_auth_digest. Additionally, sessions using the plain Session class ( rather than one of its deprecated subtypes) have a [class@ContentDecoder] by default.

Note that all async methods will invoke their callbacks on the thread-default context at the time of the function call.


Namespace: Soup
Package: libsoup-3.0

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class GLib.Object



2022 vala-language.org