Soup.Request

g GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object Soup.Request Soup.Request GObject.Object->Soup.Request Gio.Initable->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)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

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 None if not known.
Return type:str or 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.

get_uri()
Returns:self’s URI
Return type:Soup.URI

Gets self’s URI

New in version 2.42.

send(cancellable)
Parameters:cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None
Raises:GLib.Error
Returns:a Gio.InputStream that 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.InputStream that can be used to read its contents.

Note that you cannot use this method with Soup.Requests attached to a Soup.SessionAsync.

New in version 2.42.

send_async(cancellable, callback, *user_data)
Parameters:

Begins an asynchronously request for the URI pointed to by self.

Note that you cannot use this method with Soup.Requests attached to a Soup.SessionSync.

New in version 2.42.

send_finish(result)
Parameters:result (Gio.AsyncResult) – the Gio.AsyncResult
Raises:GLib.Error
Returns:a Gio.InputStream that 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_check_uri(uri) virtual
Parameters:uri (Soup.URI) –
Return type:bool
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 None if not known.
Return type:str or 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.Cancellable or None) – a Gio.Cancellable or None
Returns:a Gio.InputStream that 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.InputStream that can be used to read its contents.

Note that you cannot use this method with Soup.Requests attached to a Soup.SessionAsync.

New in version 2.42.

do_send_async(cancellable, callback, *user_data) virtual
Parameters:

Begins an asynchronously request for the URI pointed to by request.

Note that you cannot use this method with Soup.Requests attached to a Soup.SessionSync.

New in version 2.42.

do_send_finish(result) virtual
Parameters:result (Gio.AsyncResult) – the Gio.AsyncResult
Returns:a Gio.InputStream that 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.

Soup.Request.props.uri
Name:uri
Type:Soup.URI
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The request URI.

New in version 2.42.