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
2
votes
2 answers

Increasing request timeout for Network.HTTP.Conduit

I use the http-conduit library version 2.0+ to fetch the contents from a HTTP webservice: import Network.HTTP.Conduit main = do content <- simpleHttp "http://stackoverflow.com" print $ content As stated in the docs, the default timeout is…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
2
votes
1 answer

RequestBody is applied to too many type arguments

What doesn't the following function doesn't typecheck: import qualified Control.Exception as E import Data.Conduit (ResourceT) import Network.HTTP.Types (Method, Status(..)) import Network.HTTP.Conduit import qualified Data.ByteString.Lazy.Char8 as…
Sibi
  • 47,472
  • 16
  • 95
  • 163
1
vote
0 answers

Lifting the mond in conduit

I’m trying to consume an streamed http response. Problem is httpSource expects a MonadResource in the output conduit and I’m in IO so I figured I would get out a ResourceT IO : main :: IO () main = do let c :: ConduitT () (Either String…
Ashkan Kh. Nazary
  • 21,844
  • 13
  • 44
  • 68
1
vote
0 answers

Repairing streamed HTTP chunks in Haskell conduit

I'm streaming chess PGNs from the Lichess API. Streaming is recommended, since any given user could have up to ~500,000 games stored. The goal is to parse the PGNs in a parsePGNStream conduit as they're coming in. Unfortunately, the stream chunking…
staletidings
  • 57
  • 1
  • 1
  • 7
1
vote
0 answers

tlsClientParameters contains keystore password with special character ''+" and it gives error

I am using Apache CXF endpoint with Http Conduit xml for keystore certificate and password with proxy settings. It is used for consuming SOAP webservice. But my certificate contains some special characters eg- '+' Please suggest some way to…
1
vote
1 answer

Log all requests and responses for http-conduit

I have written this ManagerSettings to log all requests and responses for my http-conduit application. (By the way, I am importing ClassyPrelude). tracingManagerSettings :: ManagerSettings tracingManagerSettings = tlsManagerSettings {…
Robin Green
  • 32,079
  • 16
  • 104
  • 187
1
vote
0 answers

How to configure CXF in Spring Boot setting disableCNCheck to true in HttpConduit TLSClientParameters

There is a Spring Boot application that use Camel cxf component declared in class annotaed with @Configuration and containing the next code: @Bean public CxfEndpoint cxfEndpoint() { CxfEndpoint cxfEndpoint = new CxfEndpoint(); …
Tvori
  • 298
  • 8
  • 19
1
vote
0 answers

FromJSON [Object] implementation

I have a project where I need to parse JSON. I get a list of objects, but it's all contained inside the "data" key. Currently I have a little object to help me : data StorageList = StorageList { sl :: [Storage] } instance FromJSON StorageList…
Ulrar
  • 895
  • 8
  • 17
1
vote
1 answer

Access to HttpConduit before loading WSDL on CXF Dynamic Client

Before loading WSDL from https URL for my dynamic client I need to set appropriate configuration on HttpConduit to avoid all SSL errors. According to docs we could hardcode conduit but not sure to do it programmatically. Is there way I could get…
Stackee007
  • 3,196
  • 1
  • 26
  • 39
1
vote
2 answers

Understanding error in haskell

I (New to Haskell) am trying to perform unpack operation on ByteString that I receive from webpage. Basically I want to search few words from webpage so I am trying to tokenize stream, then search word from words. Prelude Network.HTTP.Conduit LB>…
Manvi
  • 1,136
  • 2
  • 18
  • 41
1
vote
1 answer

HTTP manager shared state corruption when sending wrong length for stream

Given a shared HTTP manager, it seems that if the requestBody is of type requestBodySource and if wrong length is supplied for the request body, then subsequent requests will crap out on same HTTP manager for about 20 seconds. There seems to be…
Sal
  • 4,312
  • 1
  • 17
  • 26
1
vote
1 answer

Constructing RequestBodyStream from Lazy ByteString when length is known

I am trying to adapt this AWS S3 upload code to handle Lazy ByteString where length is already known (so that it is not forced to be read in its entirety in memory - it comes over the network where length is sent beforehand). It seems I have to…
Sal
  • 4,312
  • 1
  • 17
  • 26
1
vote
1 answer

How do you get http-conduit to accept self-signed certificates?

I have created a program using http-conduit and it needs to talk to a server that doesn't have a valid TLS certificate. It's a self-signed certificate in this case. https-test.hs: #!/usr/bin/env stack -- stack --install-ghc --resolver lts-5.13…
Alain O'Dea
  • 21,033
  • 1
  • 58
  • 84
1
vote
1 answer

Get the status code of a webpage in Haskell

I'm trying to find a way to check if a webpage exists in Haskell. The server is HTTP2 / HTTPS only and I'm trying to check if the page exists in a servant application. Is there any Haskell packages with good documentation to just check if the status…
Thibaud Dauce
  • 367
  • 4
  • 14
1
vote
1 answer

Piping an http stream through a haskell conduit

I am trying to create a conduit that will stream data from HTTP through a conduit source. Here is what I have so far: import qualified Network.HTTP.Client.Conduit as CC getStream :: String -> IO (ConduitM () BS.ByteString IO ()) getStream url = do …
fakedrake
  • 6,528
  • 8
  • 41
  • 64