Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/HTTPS-Authenticated/Haskell/https-authenticated.hs
Normal file
27
Task/HTTPS-Authenticated/Haskell/https-authenticated.hs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Main (main) where
|
||||
|
||||
import Data.Aeson (Value)
|
||||
import Data.Default.Class (def)
|
||||
import Network.HTTP.Req
|
||||
( (/:)
|
||||
, GET(..)
|
||||
, NoReqBody(..)
|
||||
, basicAuth
|
||||
, https
|
||||
, jsonResponse
|
||||
, req
|
||||
, responseBody
|
||||
, runReq
|
||||
)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
response <- runReq def $ req
|
||||
GET
|
||||
(https "httpbin.org" /: "basic-auth" /: "someuser" /: "somepassword")
|
||||
NoReqBody
|
||||
jsonResponse
|
||||
(basicAuth "someuser" "somepassword")
|
||||
print (responseBody response :: Value)
|
||||
Loading…
Add table
Add a link
Reference in a new issue