gi-soup-2.4.25: Libsoup bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Soup.Objects.ContentSniffer

Description

No description available in the introspection data.

Synopsis

Exported types

class (GObject o, IsDescendantOf ContentSniffer o) => IsContentSniffer o Source #

Type class for types which can be safely cast to ContentSniffer, for instance with toContentSniffer.

Instances

Instances details
(GObject o, IsDescendantOf ContentSniffer o) => IsContentSniffer o Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

toContentSniffer :: (MonadIO m, IsContentSniffer o) => o -> m ContentSniffer Source #

Cast to ContentSniffer, for types for which this is known to be safe. For general casts, use castTo.

Methods

getBufferSize

contentSnifferGetBufferSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentSniffer a) 
=> a

sniffer: a ContentSniffer

-> m Word64

Returns: the number of bytes to sniff

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

Since: 2.28

new

contentSnifferNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ContentSniffer

Returns: a new ContentSniffer

Creates a new ContentSniffer.

Since: 2.28

sniff

contentSnifferSniff Source #

Arguments

:: (HasCallStack, MonadIO m, IsContentSniffer a, IsMessage b) 
=> a

sniffer: a ContentSniffer

-> b

msg: the message to sniff

-> Buffer

buffer: a buffer containing the start of msg's response body

-> m (Text, Map Text Text)

Returns: the sniffed Content-Type of buffer; this will never be Nothing, but may be "application/octet-stream".

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

Since: 2.28