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.InitableAbstract: No Structure: Soup.RequestClassA 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: intGets the length of the data represented by self. For most request types, this will not be known until after you call
Soup.Request.send() orSoup.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: strorNoneGets the type of the data represented by self. For most request types, this will not be known until after you call
Soup.Request.send() orSoup.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.SessionReturn type: Soup.SessionGets self’s
Soup.SessionNew in version 2.42.
-
send(cancellable)¶ Parameters: cancellable ( Gio.CancellableorNone) – aGio.CancellableorNoneRaises: GLib.ErrorReturns: a Gio.InputStreamthat can be used to read from the URI pointed to by self.Return type: Gio.InputStreamSynchronously 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 aSoup.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 aSoup.SessionSync.New in version 2.42.
- cancellable (
-
send_finish(result)¶ Parameters: result ( Gio.AsyncResult) – theGio.AsyncResultRaises: GLib.ErrorReturns: a Gio.InputStreamthat can be used to read from the URI pointed to by self.Return type: Gio.InputStreamGets 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: intGets the length of the data represented by request. For most request types, this will not be known until after you call
Soup.Request.send() orSoup.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: strorNoneGets the type of the data represented by request. For most request types, this will not be known until after you call
Soup.Request.send() orSoup.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.CancellableorNone) – aGio.CancellableorNoneReturns: a Gio.InputStreamthat can be used to read from the URI pointed to by request.Return type: Gio.InputStreamSynchronously 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 aSoup.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 aSoup.SessionSync.New in version 2.42.
- cancellable (
-
do_send_finish(result) virtual¶ Parameters: result ( Gio.AsyncResult) – theGio.AsyncResultReturns: a Gio.InputStreamthat can be used to read from the URI pointed to by request.Return type: Gio.InputStreamGets the result of a
Soup.Request.send_async().New in version 2.42.
-
Property Details¶
-
Soup.Request.props.session¶ Name: sessionType: Soup.SessionDefault Value: NoneFlags: READABLE,WRITABLE,CONSTRUCT_ONLYThe request’s
Soup.Session.New in version 2.42.