EDataServer.SoupSession¶
| Subclasses: | EDataServer.WebDAVSession | 
|---|
Methods¶
| Inherited: | Soup.Session (33), GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(source) | 
| class | util_normalize_uri_path(suri) | 
| class | util_status_to_string(status_code, reason_phrase) | 
| check_result(request, read_bytes, bytes_length) | |
| dup_credentials() | |
| get_authentication_requires_credentials() | |
| get_log_level() | |
| get_source() | |
| get_ssl_error_details() | |
| new_request(method, uri_string) | |
| new_request_uri(method, uri) | |
| send_request_simple_sync(request, cancellable) | |
| send_request_sync(request, cancellable) | |
| set_credentials(credentials) | |
| setup_logging(logging_level) | 
Virtual Methods¶
| Inherited: | Soup.Session (9), GObject.Object (7) | 
|---|
Properties¶
| Inherited: | Soup.Session (20) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| credentials | EDataServer.NamedParameters | r/w/en | |
| source | EDataServer.Source | r/w/co | 
Signals¶
| Inherited: | Soup.Session (6), GObject.Object (1) | 
|---|
Fields¶
| Inherited: | Soup.Session (6), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | Soup.Session | r | 
Class Details¶
- 
class EDataServer.SoupSession(**kwargs)¶
- Bases: - Soup.Session- Abstract: - No - Structure: - EDataServer.SoupSessionClass- Contains only private data that should be read and manipulated using the functions below. - New in version 3.26. - 
classmethod new(source)¶
- Parameters: - source ( - EDataServer.Source) – an- EDataServer.Source- Returns: - a new - EDataServer.SoupSession; free it with- GObject.Object.unref(), when no longer needed.- Return type: - EDataServer.SoupSession- Creates a new - EDataServer.SoupSessionassociated with given source. The source can be used to store and read SSL trust settings, but only if it already contains an- EDataServer.SourceWebdavextension. Otherwise the SSL trust settings are ignored.- New in version 3.26. 
 - 
classmethod util_normalize_uri_path(suri)¶
- Parameters: - suri ( - Soup.URI) – a- Soup.URIto normalize the path for- Returns: - whether made any changes - Return type: - bool- Normalizes the path of the suri, aka encodes characters, which should be encoded, if needed. Returns, whether any change had been made to the path. It doesn’t touch other parts of the suri. - New in version 3.38. 
 - 
classmethod util_status_to_string(status_code, reason_phrase)¶
- Parameters: - Returns: - Error text based on given arguments. The returned value is valid as long as reason_phrase is not freed. - Return type: - Returns the reason_phrase, if it’s non- - Noneand non-empty, a static string corresponding to status_code. In case neither that can be found a localized “Unknown error” message is returned.- New in version 3.26. 
 - 
check_result(request, read_bytes, bytes_length)¶
- Parameters: - request (Soup.RequestHTTP) – aSoup.RequestHTTP
- read_bytes (objectorNone) – optional bytes which had been read from the stream, orNone
- bytes_length (int) – how many bytes had been read; ignored when read_bytes isNone
 - Raises: - Returns: - Whether succeeded, aka - True, when no error recognized and- Falseotherwise.- Return type: - Checks result of the request and sets the error if it failed. When it failed and the read_bytes is provided, then these are set to request’s message response_body, thus it can be used later. - New in version 3.26. 
- request (
 - 
dup_credentials()¶
- Returns: - A copy of the credentials being previously set with - EDataServer.SoupSession.set_credentials(), or- Nonewhen none are set. Free the returned pointer with- EDataServer.NamedParameters.free(), when no longer needed.- Return type: - EDataServer.NamedParametersor- None- New in version 3.26. 
 - 
get_authentication_requires_credentials()¶
- Returns: - Whether the last connection attempt required any credentials. Authentications like OAuth2 do not want extra credentials to work. - Return type: - bool- New in version 3.28. 
 - 
get_log_level()¶
- Returns: - Current log level, as - Soup.LoggerLogLevel- Return type: - Soup.LoggerLogLevel- New in version 3.26. 
 - 
get_source()¶
- Returns: - Associated - EDataServer.Sourcewith the self.- Return type: - EDataServer.Source- New in version 3.26. 
 - 
get_ssl_error_details()¶
- Returns: - Whether the information was available and set to the out parameters. - out_certificate_pem: - return location for a server TLS/SSL certificate in PEM format, when the last operation failed with a TLS/SSL error - out_certificate_errors: - return location for a - Gio.TlsCertificateFlags, with certificate error flags when the the operation failed with a TLS/SSL error- Return type: - ( - bool, out_certificate_pem:- str, out_certificate_errors:- Gio.TlsCertificateFlags)- Populates out_certificate_pem and out_certificate_errors with the last values returned on - Soup.Status.SSL_FAILEDerror.- New in version 3.26. 
 - 
new_request(method, uri_string)¶
- Parameters: - Raises: - Returns: - a new - Soup.RequestHTTP, or- Noneon error- Return type: - Creates a new - Soup.RequestHTTP, similar to- Soup.Session.request_http(), but also presets request headers with “User-Agent” to be “Evolution/version” and with “Connection” to be “close”.- See also - EDataServer.SoupSession.new_request_uri().- New in version 3.26. 
 - 
new_request_uri(method, uri)¶
- Parameters: - Raises: - Returns: - a new - Soup.RequestHTTP, or- Noneon error- Return type: - Creates a new - Soup.RequestHTTP, similar to- Soup.Session.request_http_uri(), but also presets request headers with “User-Agent” to be “Evolution/version” and with “Connection” to be “close”.- See also - EDataServer.SoupSession.new_request().- New in version 3.26. 
 - 
send_request_simple_sync(request, cancellable)¶
- Parameters: - request (Soup.RequestHTTP) – aSoup.RequestHTTPto send
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - A newly allocated - GLib.ByteArray, which contains whole content from the URI pointed to by request.- Return type: - Similar to - EDataServer.SoupSession.send_request_sync(), except it reads whole response content into memory and returns it as a- GLib.ByteArray. Use- EDataServer.SoupSession.send_request_sync() when you want to have more control on the content read.- The function prints read content to stdout when - EDataServer.SoupSession.get_log_level() returns- Soup.LoggerLogLevel.BODY.- New in version 3.26. 
- request (
 - 
send_request_sync(request, cancellable)¶
- Parameters: - request (Soup.RequestHTTP) – aSoup.RequestHTTPto send
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - A newly allocated - Gio.InputStream, that can be used to read from the URI pointed to by request. Free it with- GObject.Object.unref(), when no longer needed.- Return type: - Synchronously sends prepared request and returns - Gio.InputStreamthat can be used to read its contents.- This calls - Soup.Request.send() internally, but it also setups the request according to- EDataServer.SoupSession- :sourceauthentication settings. It also extracts information about used certificate, in case of- Soup.Status.SSL_FAILEDerror and keeps it for later use by- EDataServer.SoupSession.get_ssl_error_details().- Use - EDataServer.SoupSession.send_request_simple_sync() to read whole content into a- GLib.ByteArray.- Note that - Soup.Sessiondoesn’t log content read from- Gio.InputStream, thus the caller may print the read content on its own when needed.- Note the request is fully filled only after there is anything read from the resulting - Gio.InputStream, thus use- EDataServer.SoupSession.check_result() to verify that the receive had been finished properly.- New in version 3.26. 
- request (
 - 
set_credentials(credentials)¶
- Parameters: - credentials ( - EDataServer.NamedParametersor- None) – an- EDataServer.NamedParameterswith credentials to use, or- None- Sets credentials to use for connection. Using - Nonefor credentials unsets previous value.- New in version 3.26. 
 - 
setup_logging(logging_level)¶
- Parameters: - logging_level ( - stror- None) – logging level to setup, or- None- Setups logging for the self. The logging_level can be one of: “all” - log whole raw communication; “body” - the same as “all”; “headers” - log the headers only; “min” - minimal logging; “1” - the same as “all”. Any other value, including - None, disables logging.- Use - EDataServer.SoupSession.get_log_level() to get current log level.- New in version 3.26. 
 
- 
classmethod 
Property Details¶
- 
EDataServer.SoupSession.props.credentials¶
- Name: - credentials- Type: - EDataServer.NamedParameters- Default Value: - None- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The - EDataServer.NamedParameterscontaining login credentials.- New in version 3.26. 
- 
EDataServer.SoupSession.props.source¶
- Name: - source- Type: - EDataServer.Source- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The - EDataServer.Sourcebeing used for this soup session.- New in version 3.26.