http-encodings-0.9.1: A library for encoding and decoding bodies of HTTP messages

Safe HaskellNone
LanguageHaskell2010

Network.HTTP.Encoding.Content

Description

Deals with content encoding (compression) of message bodies: detection, update and compression/decompression

Synopsis

Documentation

data ContentEncoding Source

Represents the content encoding, per the HTTP/1.1 standard.

getContentEncoding :: [Header] -> ContentEncoding Source

Determines the content encoding from a list of headers. Defaults to IdentityCompression

updateContentEncoding :: ContentEncoding -> [Header] -> [Header] Source

Given the list of headers, updates content encoding to the specified.

decompress :: ContentEncoding -> ByteString -> Either EncodingError ByteString Source

Decompresses a Bytestring assuming a given content encoding. The Compress encoding (LZW algorithm) is not supported at this time.

compress :: ContentEncoding -> ByteString -> Either EncodingError ByteString Source

Compresses a Bytestring assuming a given content encoding. The Compress encoding (LZW algorithm) is not supported at this time.