SoupSession
Object Hierarchy:
Description:
[ CCode ( type_id = "e_soup_session_get_type ()" ) ]
[ Version ( since = "3.26" ) ]
public class SoupSession : Session
[ Version ( since = "3.26" ) ]
public class SoupSession : Session
Contains only private data that should be read and manipulated using the functions below.
All known sub-classes:
Namespace: E
Package: libedataserver-1.2
Content:
Properties:
- public NamedParameters credentials { owned get; set; }
The NamedParameters containing login credentials.
- public bool force_http1 { get; set; }
Whether the messages created by the session should force use of HTTP/1 instead of trying HTTP/2 first and fallback to the HTTP/1 when the newer version failed to connect.
- public Source source { get; construct; }
The Source being used for this soup session.
Static methods:
- public static Quark error_quark ()
- public static bool util_get_force_http1_supported ()
Checks whether set_force_http1 can be used to force HTTP/1 usage.
- public static unowned ByteArray? util_get_message_bytes (Message message)
Returns bytes read from the message response, when the message send failed.
- public static Uri? util_normalize_uri_path (Uri uri)
Normalizes the path of the
uri
, aka encodes characters, which should be encoded, if needed. - public static InputStream? util_ref_message_request_body (Message message, out ssize_t out_length)
Returns referenced request data for the
message
, as being previously set by the util_set_message_request_body or util_set_message_request_body_from_data. - public static void util_set_message_request_body (Message message, string? content_type, InputStream input_stream, ssize_t length)
Sets the request body of the
message
from theinput_stream
of thelength
, with optionalcontent_type
. - public static void util_set_message_request_body_from_data (Message message, bool create_copy, string? content_type, void* data, ssize_t length, DestroyNotify? free_func)
Sets the request body of the
message
from thedata
of thelength
, with optionalcontent_type
. - public static unowned string util_status_to_string (uint status_code, string? reason_phrase)
Returns the
reason_phrase
, if it's non-%NULL and non-empty, a static string corresponding tostatus_code
.
Creation methods:
- public SoupSession (Source source)
Creates a new SoupSession associated with given
source
.
Methods:
- public bool check_result (Message message, void* read_bytes, size_t bytes_length) throws Error
Checks result of the
message
and sets theerror
if it failed. - public NamedParameters? dup_credentials ()
- public bool get_authentication_requires_credentials ()
- public bool get_force_http1 ()
Returns whether it's forced to use HTTP/1 for the messages created by the this.
- public LoggerLogLevel get_log_level ()
- public unowned Source? get_source ()
Returns an Source associated with the this, if such was set in the creation time.
- public bool get_ssl_error_details (out string out_certificate_pem, out TlsCertificateFlags out_certificate_errors)
Populates
out_certificate_pem
andout_certificate_errors
with the last values returned on BAD_CERTIFICATE error. - public void handle_authentication_failure (NamedParameters? credentials, Error op_error, out SourceAuthenticationResult out_auth_result, out string out_certificate_pem, out TlsCertificateFlags out_certificate_errors) throws Error
Handles authentication failure and sets appropriate value to the
out_auth_result
for the providedop_error
and usedcredentials
. - public Message new_message (string method, string uri_string) throws Error
- public Message new_message_from_uri (string method, Uri uri) throws Error
Creates a new Message , similar to Message.from_uri, but also presets request headers with "User-Agent" to be "Evolution/version" and with "Connection" to be "close".
- public void* prepare_message_send_sync (Message message, Cancellable? cancellable = null) throws Error
Prepares the
message
to be a sent asynchronously with send_message. - public async InputStream? send_message (Message message, int io_priority, void* prepare_data, Cancellable? cancellable, out string? out_certificate_pem, out TlsCertificateFlags out_certificate_errors) throws Error
Asynchronously sends the
message
. - public ByteArray send_message_simple_sync (Message message, Cancellable? cancellable = null) throws Error
Similar to send_message_sync, except it reads whole response content into memory and returns it as a ByteArray.
- public InputStream send_message_sync (Message message, Cancellable? cancellable = null) throws Error
Synchronously sends prepared message and returns InputStream that can be used to read its contents.
- public void set_credentials (NamedParameters? credentials)
Sets credentials to use for connection.
- public void set_force_http1 (bool force_http1)
Sets whether the messages created through the this using new_message or new_message_from_uri should force use of the HTTP/1, instead of trying HTTP/2 and fallback to HTTP/1, when the newer version cannot be used.
- public void setup_logging (string? logging_level)
Setups logging for the this.
Inherited Members:
All known members inherited from class Soup.Session
- abort
- accept_language
- accept_language_auto
- add_feature
- add_feature_by_type
- get_accept_language
- get_accept_language_auto
- get_async_result_message
- get_feature
- get_feature_for_message
- get_idle_timeout
- get_local_address
- get_max_conns
- get_max_conns_per_host
- get_proxy_resolver
- get_remote_connectable
- get_timeout
All known members inherited from class GLib.Object