Skip to content
Snippets Groups Projects
Commit 947c243e authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Add cabal and requests.

parent b43674ce
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE OverloadedStrings #-}
module Request where
import Network.HTTP.Req
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
import Control.Monad.IO.Class
postRequest :: IO ()
postRequest = runReq defaultHttpConfig $ do
let url = https "boundvariable.space" /: "communicate"
let body :: ByteString
body = BS.pack "S'%4}).$%8"
let headers = header "Authorization" "Bearer 8cd1314b-f873-4ab7-891f-781d814ed60e" <>
header "User-Agent" "Närke Nation"
response <- req
POST
url
(ReqBodyBs body)
bsResponse
headers
liftIO $ BS.putStrLn $ responseBody response
cabal-version: >= 1.10
name: icfpc2024
version: 0.1
license: AGPL
author: Hugo Hörnquist, Nathaniel Mattsson
maintainer: hugo@lysator.liu.se
homepage: https://git.lysator.liu.se/boomknife/icfp-contest-2024
category: Network
build-type: Simple
executable Main
main-is: main.hs
ghc-options: -threaded -Wall -W
-Wno-missing-signatures
other-modules:
Eval,
Expression,
Parse,
Request,
Serialize
build-depends:
base >=4.9,
bytestring,
containers,
mtl,
req,
parsec
default-language: Haskell2010
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment