Soup.ContentSniffer¶
| Subclasses: | None |
|---|
Methods¶
| Inherited: | GObject.Object (37), Soup.SessionFeature (5) |
|---|---|
| Structs: | GObject.ObjectClass (5) |
| class | new () |
get_buffer_size () |
|
sniff (msg, buffer) |
Virtual Methods¶
| Inherited: | GObject.Object (7), Soup.SessionFeature (8) |
|---|
do_get_buffer_size () |
|
do_sniff (msg, buffer) |
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) |
|---|
Class Details¶
-
class
Soup.ContentSniffer(**kwargs)¶ Bases: GObject.Object,Soup.SessionFeatureAbstract: No Structure: Soup.ContentSnifferClass-
classmethod
new()¶ Returns: a new Soup.ContentSnifferReturn type: Soup.ContentSnifferCreates a new
Soup.ContentSniffer.New in version 2.28.
-
get_buffer_size()¶ Returns: the number of bytes to sniff Return type: intGets the number of bytes self needs in order to properly sniff a buffer.
New in version 2.28.
-
sniff(msg, buffer)¶ Parameters: - msg (
Soup.Message) – the message to sniff - buffer (
Soup.Buffer) – a buffer containing the start of msg’s response body
Returns: the sniffed Content-Type of buffer; this will never be
None, but may be “application/octet-stream”.params: return location for Content-Type parameters (eg, “charset”), or NoneReturn type: Sniffs buffer to determine its Content-Type. The result may also be influenced by the Content-Type declared in msg’s response headers.
New in version 2.28.
- msg (
-
do_get_buffer_size() virtual¶ Returns: the number of bytes to sniff Return type: intGets the number of bytes sniffer needs in order to properly sniff a buffer.
New in version 2.28.
-
do_sniff(msg, buffer) virtual¶ Parameters: - msg (
Soup.Message) – the message to sniff - buffer (
Soup.Buffer) – a buffer containing the start of msg’s response body
Returns: the sniffed Content-Type of buffer; this will never be
None, but may be “application/octet-stream”.params: return location for Content-Type parameters (eg, “charset”), or NoneReturn type: Sniffs buffer to determine its Content-Type. The result may also be influenced by the Content-Type declared in msg’s response headers.
New in version 2.28.
- msg (
-
classmethod