Haskell library for client-side HTTP requests, focused on ease of use.
Questions tagged [wreq]
20 questions
0
votes
1 answer
Traversing JSON in Haskell with wreq - key issues
I'm trying to traverse some JSON response I'm getting from the OpenWeatherMap API but I'm getting some issues to retrieve some values. Here is my code:
{-# LANGUAGE OverloadedStrings #-}
import Control.Lens
import Data.Aeson.Lens (_String,…

David B.
- 371
- 5
- 17
0
votes
1 answer
Control Monad (when or the likes) and non IO() return types
I am trying to use the "when" function in my program because I want to have an action preformed if something is true and not if its not true.
I could also accomplish the same thing by using the Maybe monad but that will clutter the rest of my…

John Brown
- 13
- 5
0
votes
1 answer
Parsing JSON haskell
I am trying to access the inner Object in my request. This is my code:
{-# LANGUAGE OverloadedStrings #-}
import Network.Wreq
import Control.Lens
import Data.Aeson
import Data.Map as Map
type Resp = Response (Map String Value)
main = do
r…

Jimbo
- 331
- 1
- 13
0
votes
1 answer
How to display Response from an HTTP GET Request in front-end using Scotty?
I'm trying out Scotty for the first time and I can't seem to get past making my GET request. The Response is returned as type
IO (Response bytestring-0.10.8.1:Data.ByteString.Lazy.Internal.ByteString)
I know I need to convert it to a type that…

Kahlil Abreu
- 48
- 7
0
votes
1 answer
Send request as content type of x-www-form-urlencoded with wreq
I'm learning to use wreq this weekend and I've run into some strange behavior.
I have a module AuthRequest
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module AuthRequest where
import Data.Aeson
import GHC.Generics
import…

munk
- 12,340
- 8
- 51
- 71