post - Haskell, Posting Values to Webpage -
I am trying to display GET and POST for websites in Haskell, and I also have trouble finding this address Find out how to make a simple post. I'm sure this is a GET.
Import Networks http. Context import data Context import data Conrad. Binary (syncfile) importable data. Biotrading L import control as LG Monad.IO.Class (liftIO) import control. Monad Trains Resource (runResourceT) Main :: IO () Main = Run Run Resource $ tax case Parse URL "https://www.google.com" Nothing - & gt; LiftIO $ putStr "Not a valid URL" just request - & gt; $ Manager with manager - & gt; Do ridge and lieutenant; - httpLbs rake manager LITO L.putStr $ responseBody res
Can anyone show me an example how to post in the mail? I have tried to find a better example, which I understand I can not, but I have not got any luck! Can you please post me using the "Login" -> "James", "Pass" -> "Mypassword". thank you in advanced!
You need to change the request
data type to notify you This is a post
method call also make sure that you have the latest http-client (version 0.3.6)
installed because Michael Snoeman recently added the function .
{- # LANGUAGE overloaded strings # -} Import Networks http. Conrad import control Monad.io Class importable data Biotrading L import control as L Monad Trance Resource Key :: Io (main) = RunsROSRSRT $ dot init rick & lt; - ParseUrl "https://www.google.com" let \ initReq {method = "POST"} req '= setQueryString [("login", just "James"), ("pass", just "mypassword")] Manager with Manager $ \ manager - & gt; What to do & lt; - httpLbs req 'manager liftIO L.putStr $ responseBody res
Comments
Post a Comment