ContentSniffer

A #SoupContentSniffer tries to detect the actual content type of the files that are being downloaded by looking at some of the data before the #SoupMessage emits its #SoupMessage::got-headers signal. #SoupContentSniffer implements #SoupSessionFeature, so you can add content sniffing to a session with soup_session_add_feature() or soup_session_add_feature_by_type().

Constructors

this
this(SoupContentSniffer* soupContentSniffer, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new #SoupContentSniffer.

Members

Functions

getBufferSize
size_t getBufferSize()

Gets the number of bytes @sniffer needs in order to properly sniff a buffer.

getContentSnifferStruct
SoupContentSniffer* getContentSnifferStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

sniff
string sniff(Message msg, Buffer buffer, HashTable params)

Sniffs @buffer to determine its Content-Type. The result may also be influenced by the Content-Type declared in @msg's response headers.

Mixins

__anonymous
mixin SessionFeatureT!(SoupContentSniffer)
Undocumented in source.

Static functions

getType
GType getType()

Variables

soupContentSniffer
SoupContentSniffer* soupContentSniffer;

the main Gtk struct

Inherited Members

From SessionFeatureIF

getSessionFeatureStruct
SoupSessionFeature* getSessionFeatureStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
addFeature
bool addFeature(GType type)

Adds a "sub-feature" of type @type to the base feature @feature. This is used for features that can be extended with multiple different types. Eg, the authentication manager can be extended with subtypes of #SoupAuth.

attach
void attach(Session session)
detach
void detach(Session session)
hasFeature
bool hasFeature(GType type)

Tests if @feature has a "sub-feature" of type @type. See soup_session_feature_add_feature().

removeFeature
bool removeFeature(GType type)

Removes the "sub-feature" of type @type from the base feature @feature. See soup_session_feature_add_feature().

Meta

Since

2.28