Soup.Request¶
| Subclasses: | Soup.RequestData,Soup.RequestFile,Soup.RequestHTTP | 
|---|
Methods¶
| Inherited: | GObject.Object (37), Gio.Initable (2) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| get_content_length() | |
| get_content_type() | |
| get_session() | |
| get_uri() | |
| send(cancellable) | |
| send_async(cancellable, callback, *user_data) | |
| send_finish(result) | 
Virtual Methods¶
| Inherited: | GObject.Object (7), Gio.Initable (1) | 
|---|
| do_check_uri(uri) | |
| do_get_content_length() | |
| do_get_content_type() | |
| do_send(cancellable) | |
| do_send_async(cancellable, callback, *user_data) | |
| do_send_finish(result) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| session | Soup.Session | r/w/co | The request’s session | 
| uri | Soup.URI | r/w/co | The request URI | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Soup.Request(**kwargs)¶
- Bases: - GObject.Object,- Gio.Initable- Abstract: - No - Structure: - Soup.RequestClass- A request to retrieve a particular URI. - New in version 2.42. - 
get_content_length()¶
- Returns: - the length of the data represented by self, or -1 if not known. - Return type: - int- Gets the length of the data represented by self. For most request types, this will not be known until after you call - Soup.Request.send() or- Soup.Request.send_finish().- New in version 2.42. 
 - 
get_content_type()¶
- Returns: - the type of the data represented by self, or - Noneif not known.- Return type: - stror- None- Gets the type of the data represented by self. For most request types, this will not be known until after you call - Soup.Request.send() or- Soup.Request.send_finish().- As in the HTTP Content-Type header, this may include parameters after the MIME type. - New in version 2.42. 
 - 
get_session()¶
- Returns: - self’s - Soup.Session- Return type: - Soup.Session- Gets self’s - Soup.Session- New in version 2.42. 
 - 
send(cancellable)¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – a- Gio.Cancellableor- None- Raises: - GLib.Error- Returns: - a - Gio.InputStreamthat can be used to read from the URI pointed to by self.- Return type: - Gio.InputStream- Synchronously requests the URI pointed to by self, and returns a - Gio.InputStreamthat can be used to read its contents.- Note that you cannot use this method with - Soup.Requestsattached to a- Soup.SessionAsync.- New in version 2.42. 
 - 
send_async(cancellable, callback, *user_data)¶
- Parameters: - cancellable (Gio.CancellableorNone) – aGio.CancellableorNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallback
- user_data (objectorNone) – user data passed to callback
 - Begins an asynchronously request for the URI pointed to by self. - Note that you cannot use this method with - Soup.Requestsattached to a- Soup.SessionSync.- New in version 2.42. 
- cancellable (
 - 
send_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – the- Gio.AsyncResult- Raises: - GLib.Error- Returns: - a - Gio.InputStreamthat can be used to read from the URI pointed to by self.- Return type: - Gio.InputStream- Gets the result of a - Soup.Request.send_async().- New in version 2.42. 
 - 
do_get_content_length() virtual¶
- Returns: - the length of the data represented by request, or -1 if not known. - Return type: - int- Gets the length of the data represented by request. For most request types, this will not be known until after you call - Soup.Request.send() or- Soup.Request.send_finish().- New in version 2.42. 
 - 
do_get_content_type() virtual¶
- Returns: - the type of the data represented by request, or - Noneif not known.- Return type: - stror- None- Gets the type of the data represented by request. For most request types, this will not be known until after you call - Soup.Request.send() or- Soup.Request.send_finish().- As in the HTTP Content-Type header, this may include parameters after the MIME type. - New in version 2.42. 
 - 
do_send(cancellable) virtual¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – a- Gio.Cancellableor- None- Returns: - a - Gio.InputStreamthat can be used to read from the URI pointed to by request.- Return type: - Gio.InputStream- Synchronously requests the URI pointed to by request, and returns a - Gio.InputStreamthat can be used to read its contents.- Note that you cannot use this method with - Soup.Requestsattached to a- Soup.SessionAsync.- New in version 2.42. 
 - 
do_send_async(cancellable, callback, *user_data) virtual¶
- Parameters: - cancellable (Gio.CancellableorNone) – aGio.CancellableorNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallback
- user_data (objectorNone) – user data passed to callback
 - Begins an asynchronously request for the URI pointed to by request. - Note that you cannot use this method with - Soup.Requestsattached to a- Soup.SessionSync.- New in version 2.42. 
- cancellable (
 - 
do_send_finish(result) virtual¶
- Parameters: - result ( - Gio.AsyncResult) – the- Gio.AsyncResult- Returns: - a - Gio.InputStreamthat can be used to read from the URI pointed to by request.- Return type: - Gio.InputStream- Gets the result of a - Soup.Request.send_async().- New in version 2.42. 
 
- 
Property Details¶
- 
Soup.Request.props.session¶
- Name: - session- Type: - Soup.Session- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The request’s - Soup.Session.- New in version 2.42.