gi-soup-2.4.11: Libsoup bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Objects.ContentSniffer

Contents

Description

 

Synopsis

Exported types

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