category feedHTTP clientsWeb developmenteditdelete

This category is a stub, contributions are welcome!






write something here!

edit description
or press Ctrl+Enter to savemarkdown supported
#
req (Hackage)
other
move item up move item down edit item info delete item
Summary edit summary

write something here!

Summary quit editing summary
Prosedit prosquit editing pros

    press Ctrl+Enter or Enter to addmarkdown supportededit off
    Consedit consquit editing cons

      press Ctrl+Enter or Enter to addmarkdown supportededit off
      Ecosystemedit ecosystem
      Ecosystemquit editing ecosystemor press Ctrl+Enter to savemarkdown supported
      Notes
      collapse notesedit notes

      Links

      Links to tutorials, blog posts, etc.

      Imports

      import qualified Network.HTTP.Req as R

      Usage

      [ see the hackage page for a commented example ]

      Gotchas

      The req function uses type tricks that make [R.GET, R.PUT] not type-check. If you want to pass around request parameters use a GADT like:

      -- | A Request to be compiled into an IO action. Does not specify return type
      data Request where
        Delete ::                 R.Url 'R.Https      -> Option -> Request
        Get    ::                 R.Url 'R.Https      -> Option -> Request
        Patch  :: R.HttpBody a => R.Url 'R.Https -> a -> Option -> Request
        Put    :: R.HttpBody a => R.Url 'R.Https -> a -> Option -> Request
        Post   :: R.HttpBody a => R.Url 'R.Https -> a -> Option -> Request

      The library throws exceptions on non-2XX response codes (eg 404). If this is not desired edit httpConfigCheckResponse to something like:

      instance R.MonadHttp MyCustomIOMonad where -- or just IO
        -- :: R.MonadHttp m => R.HttpException -> m a
        handleHttpException = throwIO
        -- :: Req HttpConfig
        getHttpConfig = pure $ def { R.httpConfigCheckResponse = \_ _ _ -> Nothing }
      collapse notesedit notes
      #
      wreq (Hackage)
      other
      move item up move item down edit item info delete item
      Summary edit summary

      write something here!

      Summary quit editing summary
      Prosedit prosquit editing pros

        press Ctrl+Enter or Enter to addmarkdown supportededit off
        Consedit consquit editing cons

          press Ctrl+Enter or Enter to addmarkdown supportededit off
          Ecosystemedit ecosystem
          Ecosystemquit editing ecosystemor press Ctrl+Enter to savemarkdown supported