@@ -184,11 +184,16 @@ req method url body options = do
184184 config <- getHttpConfig
185185 manager <- liftIO (readIORef globalManager)
186186 let request = flip appEndo L.defaultRequest $
187− getRequestMod (Womb method :: Womb "method" method) <>
188− getRequestMod url <>
189− getRequestMod (Womb body :: Womb "body" body) <>
187+ -- NOTE Order of 'mappend's matters, here method is overwritten
188+ -- first and 'config' takes its effect last. In particular, this
189+ -- means that 'options' can overwrite things set by 'url' and
190+ -- 'body', which is useful for setting port number, "Content-Type"
191+ -- header, etc.
192+ getRequestMod config <>
190193 getRequestMod options <>
191− getRequestMod config
194+ getRequestMod (Womb body :: Womb "body" body) <>
195+ getRequestMod url <>
196+ getRequestMod (Womb method :: Womb "method" method)
192197 liftIO (try $ getHttpResponse manager request)
193198 >>= either handleHttpException return
194199