:right-sidebar: True ContentSniffer =================================================================== .. currentmodule:: gi.repository.Soup .. class:: ContentSniffer(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Soup.SessionFeature` :Constructors: :: ContentSniffer(**properties) new() -> Soup.ContentSniffer Constructors ------------ .. rst-class:: interim-class .. class:: ContentSniffer :no-index: .. classmethod:: new() -> ~gi.repository.Soup.ContentSniffer Creates a new :obj:`~gi.repository.Soup.ContentSniffer`. Methods ------- .. rst-class:: interim-class .. class:: ContentSniffer :no-index: .. method:: sniff(msg: ~gi.repository.Soup.Message, buffer: ~gi.repository.GLib.Bytes) -> tuple[str, dict[str, str]] Sniffs ``buffer`` to determine its Content-Type. The result may also be influenced by the Content-Type declared in ``msg``'s response headers. :param msg: the message to sniff :param buffer: a buffer containing the start of ``msg``'s response body