Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
... all suck in one way or the other.
Going back to good ol' req.
demo :: Text -> IO Text
demo authToken = runReq defaultHttpConfig $ do
let auth = oAuth2Token $ encodeUtf8 authToken
userAgent = header "User-Agent" "github.com/srid/someapp"
(https "api.github.com" /: "repos" /: "srid" /: "somerepo" /: "git" /: "ref" /: "heads" /: "master")
(auth <> userAgent)
liftIO $ print (responseBody r :: Value)
pure $ toText $ shower (responseBody r :: Value)
I'd be interested in what ways they suck :slight_smile:
I did a quick hack in Python this morning, but plan to rewrite it in Haskell if it proves to be useful so knowing of limitations of the various libs available on Hackage would be very useful.
github library is good, if you can get it to work (its got its strange problems when using in obelisk as a override; so I use the stable hackage version only for its types).
Sometimes Its just easier to do it manually. Like, I was looking at the available haskell stripe API and it was very confusing; I ended up just using req and it was a lot simpler