:right-sidebar: True URISchemeResponse =================================================================== .. currentmodule:: gi.repository.WebKit .. class:: URISchemeResponse(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: URISchemeResponse(**properties) new(input_stream:Gio.InputStream, stream_length:int) -> WebKit.URISchemeResponse Constructors ------------ .. rst-class:: interim-class .. class:: URISchemeResponse :no-index: .. classmethod:: new(input_stream: ~gi.repository.Gio.InputStream, stream_length: int) -> ~gi.repository.WebKit.URISchemeResponse Create a new :obj:`~gi.repository.WebKit.URISchemeResponse` .. versionadded:: 2.36 :param input_stream: a :obj:`~gi.repository.Gio.InputStream` to read the contents of the request :param stream_length: the length of the stream or -1 if not known Methods ------- .. rst-class:: interim-class .. class:: URISchemeResponse :no-index: .. method:: set_content_type(content_type: str) -> None Sets the content type for the ``response`` .. versionadded:: 2.36 :param content_type: the content type of the stream .. method:: set_http_headers(headers: ~gi.repository.Soup.MessageHeaders) -> None Assign the provided :obj:`~gi.repository.Soup.MessageHeaders` to the response. ``headers`` need to be of the type ``%SOUP_MESSAGE_HEADERS_RESPONSE``. Any existing headers will be overwritten. .. versionadded:: 2.36 :param headers: the HTTP headers to be set .. method:: set_status(status_code: int, reason_phrase: str | None = None) -> None Sets the status code and reason phrase for the ``response``. If ``status_code`` is a known value and ``reason_phrase`` is :const:`None`, the ``reason_phrase`` will be set automatically. .. versionadded:: 2.36 :param status_code: the HTTP status code to be returned :param reason_phrase: a reason phrase Properties ---------- .. rst-class:: interim-class .. class:: URISchemeResponse :no-index: .. attribute:: props.stream :type: ~gi.repository.Gio.InputStream The input stream to read from. .. versionadded:: 2.36 .. attribute:: props.stream_length :type: int The input stream length in bytes, ``-1`` for unknown length. .. versionadded:: 2.36