http-common 0.7.0.1 → 0.7.1.1
raw patch · 3 files changed
+22/−4 lines, 3 files
Files
- http-common.cabal +1/−1
- src/Network/Http/RequestBuilder.hs +20/−3
- src/Network/Http/Types.hs +1/−0
http-common.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 1.10 name: http-common-version: 0.7.0.1+version: 0.7.1.1 synopsis: Common types for HTTP clients and servers description: /Overview/
src/Network/Http/RequestBuilder.hs view
@@ -25,6 +25,7 @@ setContentType, setContentLength, setExpectContinue,+ setTransferEncoding, setHeader ) where @@ -88,9 +89,9 @@ let h2 = updateHeader h1 "Accept-Encoding" "gzip" let e = case m of- GET -> Empty- TRACE -> Empty- _ -> Chunking+ PUT -> Chunking+ POST -> Chunking+ _ -> Empty let h3 = case e of Chunking -> updateHeader h2 "Transfer-Encoding" "chunked"@@ -264,6 +265,22 @@ deleteHeader "Transfer-Encoding" setHeader "Content-Length" (S.pack $ show n) setEntityBody $ Static n++--+-- | Override the default setting about how the entity body will be sent.+--+-- This function is special: this explicitly sets the @Transfer-Encoding:@+-- header to @chunked@ and will instruct the library to actually tranfer the+-- body as a stream ("chunked transfer encoding"). See 'setContentLength' for+-- forcing the opposite. You /really/ won't need this in normal operation, but+-- some people are control freaks.+--+setTransferEncoding :: RequestBuilder ()+setTransferEncoding = do+ deleteHeader "Content-Length"+ setEntityBody Chunking+ setHeader "Transfer-Encoding" "chunked"+ -- -- | Specify that this request should set the expectation that the
src/Network/Http/Types.hs view
@@ -37,6 +37,7 @@ setContentType, setContentLength, setExpectContinue,+ setTransferEncoding, setHeader, -- * Responses