Questions tagged [http-conduit]

A haskell HTTP client library using conduits

http-conduit is a Haskell HTTP client library using conduit for parsing the HTTP protocol.

78 questions
3
votes
2 answers

How to use Data.Default with Network.HTTP.Client

The aws package uses an instance of Default Request (in Aws/Core.hs). During the building of the package the compiler complains with the same error as below. Here is something simple that fails the same way: {-# LANGUAGE OverloadedStrings #-} import…
helpwithhaskell
  • 558
  • 4
  • 13
3
votes
1 answer

Type mismatch error in making HTTP request

Trying to make a HTTP request, I got the error: {-# LANGUAGE OverloadedStrings #-} import Network.HTTP.Conduit -- the main module -- The streaming interface uses conduits import Data.Conduit import Data.Conduit.Binary (sinkFile) import qualified…
Incerteza
  • 32,326
  • 47
  • 154
  • 261
3
votes
0 answers

http-conduit TLSSettingsSimple and error EOF problems

I'm still a haskell newbie but i'm attempting a simple http-conduit example" import Network.HTTP.Conduit -- the main module import qualified Data.ByteString.Lazy as L simpleRequest :: IO () simpleRequest = do request <- parseUrl var2 print…
prussiap
  • 667
  • 1
  • 7
  • 14
3
votes
1 answer

How can I fix a error when execute a sample code of http-conduit version 2.0.0.4

I am new to Haskell and am trying to a sample code of http-conduit version 2.0.0.4, but it dose not work Here is the sample code {-# LANGUAGE OverloadedStrings #-} import Network.HTTP.Conduit import Network import Data.Time.Clock import…
3
votes
1 answer

x-oauth-basic header isn't the same in CURL and HTTP.Conduit

This is more than likely me missing some vital piece of information or something, but here goes. Currently I'm trying to insert my own header, namely x-oauth-basic, into my HTTP request using the HTTP.Conduit library. It sorta works, but not in my…
Tehnix
  • 2,020
  • 2
  • 18
  • 23
3
votes
1 answer

ByteString expects different ByteString

This code doesn't typecheck: import Network.HTTP.Conduit import qualified Data.ByteString.Char8 as BS main :: IO () main = do resp <- simpleHttp "http://www.google.com" putStrLn $ BS.unpack resp Throws the following error: Couldn't match…
Sibi
  • 47,472
  • 16
  • 95
  • 163
2
votes
1 answer

How do I construct a Network.HTTP.Conduit.Request object?

Trying to construct a Request with Network.HTTP.Conduit package. The instructions are: The constructor for this data type is not exposed. Instead, you should use either the def method to retrieve a default instance, or parseUrl to construct…
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
2
votes
1 answer

Couldn't match expected type ‘Request’ with actual type ‘[Char]’

I'm new to Haskel, I'm trying to run a simple example using http-conduit, the example is the one provided in their documentation. However, when running the program I always get: • Couldn't match expected type ‘Request’ with actual type ‘[Char]’ …
Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
2
votes
1 answer

When I run a lot of http requests in parallel, I get "no such protocol name: tcp"

The code mapConcurrently httpLBS requests throws ConnectionFailure Network.BSD.getProtocolByName: does not exist (no such protocol name: tcp)) after about 1k requests.
Reactormonk
  • 21,472
  • 14
  • 74
  • 123
2
votes
1 answer

Why doesn't print force entire lazy IO value?

I'm using http-client tutorial to get response body using TLS connection. Since I can observe that print is called by withResponse, why doesn't print force entire response to the output in the following fragment? withResponse request manager $…
sevo
  • 4,559
  • 1
  • 15
  • 31
2
votes
1 answer

http-conduit, snap and lazy IO

I have two http-servers working with a json api using the snap framework my first prototype contains a handler similar to this example handler import Data.ByteString (ByteString) import Data.ByteString.Char8 as B (unwords,…
epsilonhalbe
  • 15,637
  • 5
  • 46
  • 74
2
votes
1 answer

How does one pipe `rawRequestBody` into `requestBodySource`?

Yesod has rawRequestBody with the following type signature: rawRequestBody :: MonadHandler m => Source m ByteString And http-conduit has this function that converts a source into a RequestBody: requestBodySource :: Int64 -> Source (ResourceT IO)…
Nathan Kot
  • 2,392
  • 1
  • 21
  • 31
2
votes
1 answer

Handling HTTP Query parameters in http-conduit

I want to download the content of the URL http://example.com/foobar?key1=value1&key2=value2 using http-conduit (GET request). How can I do that: a) Assuming I already know the full (i.e. encoded URL) b) If some parameters are dynamic and therefore…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
2
votes
1 answer

SocketTimeoutException cxf httpconduit PUT

I have a test that takes a lot of time and ended up making a timeout. I tried the solution bob and nothing it does not work. The error occurs just on tests PUT. My Test : @Test public void testUpdateUse(){ …
MaximeF
  • 4,913
  • 4
  • 37
  • 51
2
votes
0 answers

Converting Curl Https Request To Http-Conduit

Im trying to convert this curl request to HTTP-Conduit one: curl -v https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo/?schema=openid -H "Content-Type:application/json" -H "Authorization:Bearer…
CountOren
  • 844
  • 1
  • 9
  • 27