@@ -134,6 +134,9 @@ module Network.HTTP.Req
134134 , awsAuth
135135 -- *** Other
136136 , port
137+ , decompress
138+ , responseTimeout
139+ , httpVersion
137140 -- * Response
138141 , HttpResponse (..)
139142 -- * Other
@@ -653,9 +656,41 @@ port :: Word -> Option scheme
653656port n = withRequest $ \x ->
654657 x { L.port = fromIntegral n }
655658
656−-- TODO decompress
657−-- TODO responseTimeout
658−-- TODO requestVersion
659+-- | This 'Option' controls whether gzipped data should be decompressed on
660+-- the fly. By default everything except for @application\/x-tar@ is
661+-- decompressed, i.e. we have:
662+--
663+-- > decompress (/= "application/x-tar")
664+--
665+-- You can also choose to decompress everything like this:
666+--
667+-- > decompress (const True)
668+
669+decompress
670+ :: (ByteString -> Bool) -- ^ Predicate that is given MIME type, it
671+ -- returns 'True' when content should be decompressed on the fly.
672+ -> Option scheme
673+decompress f = withRequest $ \x ->
674+ x { L.decompress = f }
675+
676+-- | Specify number of microseconds to wait for response. Default is 30
677+-- seconds.
678+
679+responseTimeout
680+ :: Word -- ^ Number of microseconds to wait
681+ -> Option scheme
682+responseTimeout n = withRequest $ \x ->
683+ x { L.responseTimeout = LI.ResponseTimeoutMicro (fromIntegral n) }
684+
685+-- | HTTP version to send to server, default is HTTP 1.1.
686+
687+httpVersion
688+ :: Word -- ^ Major version number
689+ -> Word -- ^ Minor version number
690+ -> Option scheme
691+httpVersion major minor = withRequest $ \x ->
692+ x { L.requestVersion =
693+ Y.HttpVersion (fromIntegral major) (fromIntegral minor) }
659694
660695----------------------------------------------------------------------------
661696-- Response