:right-sidebar: True URISchemeResponse =================================================================== .. currentmodule:: gi.repository.WebKit .. class:: URISchemeResponse(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Represents a URI scheme response. If you register a particular URI scheme in a :obj:`~gi.repository.WebKit.WebContext`\, using :func:`~gi.repository.WebKit.WebContext.register_uri_scheme`, you have to provide a :obj:`~gi.repository.WebKit.URISchemeRequestCallback`\. After that, when a URI response is made with that particular scheme, your callback will be called. There you will be able to provide more response parameters when the methods and properties of a :obj:`~gi.repository.WebKit.URISchemeRequest` is not enough. When you finished setting up your :obj:`~gi.repository.WebKit.URISchemeResponse`\, call webkit_uri_request_finish_with_response() with it to return the response. 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 type of the None singleton. .. versionadded:: 2.36 .. attribute:: props.stream_length :type: int The type of the None singleton. .. versionadded:: 2.36