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
15
votes
1 answer

Unexpectedly low throughput for Network I/O using Scotty

I tried to benchmark Scotty to test the Network I/O efficiency and overall throughput. For this I set up two local servers written in Haskell. One which doesn't do anything and just acts as an API. Code for the same is {-# LANGUAGE OverloadedStrings…
user2512324
  • 791
  • 1
  • 6
  • 21
10
votes
1 answer

"InternalIOException getAddrInfo: does not exist (error 10093)" on Windows 8

Why is such simple code not working? import Network.HTTP.Conduit import qualified Data.ByteString.Lazy as L main :: IO () main = simpleHttp "http://www.dir.bg/" >>= L.putStr It results in the following error: TestConduit.exe: InternalIOException…
The_Ghost
  • 2,070
  • 15
  • 26
7
votes
1 answer

http-conduit browser usage

I'm trying to scrape data from a site using HTTPS. I managed to make basic requests using Network.HTTP.Conduit successfully (posting credentials, etc.), but failed at extracting cookie information from the response headers (Set-Cookie). It looks…
akosch
  • 4,326
  • 7
  • 59
  • 80
7
votes
2 answers

Downloading large files from the Internet in Haskell

Are there any suggestions about how to download large files in Haskell? I figure Http.Conduit is is the library is a good library for this. However, how does it solve this? There is an example in its documentation but it is not fit for downloading…
Incerteza
  • 32,326
  • 47
  • 154
  • 261
7
votes
2 answers

Haskell Could not find module `Network.HTTP.Conduit'

I can't get this import to work in haskell. import Network.HTTP.Conduit When I try to compile I get the following error: $ ghc Play.hs Play.hs:1:8: Could not find module `Network.HTTP.Conduit' Use -v to see a list of the files searched…
Joe
  • 1,534
  • 9
  • 19
6
votes
2 answers

How can I catch a 404 status exception thrown by simpleHttp of Http.Conduit

I'm trying to download all png files contained in an html file. I have trouble catching 404 status exceptions though, instead my program just crashes. Here is some sample to demonstrate: import Network.HTTP.Conduit import qualified…
Thorsten Lorenz
  • 11,781
  • 8
  • 52
  • 62
6
votes
2 answers

What is the dot pipe ".|" operator in Haskell?

I understand "." (dot) as function composition. I understand "|" (pipe) as "or," guard introduction syntax (from here ), but I saw an answer on http-conduits using ".|" that makes use of this operator in a way I do not understand. The other…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
6
votes
1 answer

Disable SSL/TLS certificate validation in Network.HTTP.Conduit

I use the http-conduit library version 2.0+ to fetch the contents from a http:// URL: import Network.HTTP.Conduit myurl = ... -- Your URL goes here main = do content <- simpleHttp myurl print $ content When running this program, I get…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
5
votes
2 answers

Why does httpJSON fail, but httpLBS succeeds?

This function (with httpLBS) works: makeRequest = do response <- httpLBS "http://httpbin.org/get" putStrLn $ "The status code was: " ++ show (getResponseStatusCode response) But this function (with httpJSON) does not: makeRequest = do …
TomDane
  • 1,010
  • 10
  • 25
5
votes
1 answer

calling network IO from within haskeline

I have an existing program which takes command line arguments (username, password, date) and then uses the Network.HTTP.Conduit library to post an xml message to a server. I then parse the results, do some work and use blaze-html to write out to a…
Neil
  • 345
  • 1
  • 11
4
votes
1 answer

connecting http-conduit to xml-conduit

I'm struggling converting a Response from http-conduit to an XML document via xml-conduit. The doPost function takes an XML Document and posts it to the server. The server responds with an XML Document. doPost queryDoc = do runResourceT $ do …
Neil
  • 345
  • 1
  • 11
4
votes
1 answer

Haskell Network.HTTP.Conduit Exception: InvalidProxyEnvironmentVariable "http_proxy"

I'm using the simple example from HTTP.Conduit's documentation found here. import Network.HTTP.Conduit import qualified Data.ByteString.Lazy as L main = simpleHttp "http://www.haskell.org/" >>= L.putStr My system requires a proxy which is…
user4734474
4
votes
1 answer

How can I post FileInfo to a web service using Yesod and Http-Conduit?

I am working with the default Yesod scaffolding project. I have created a page that displays a simple form to upload files. (The form will likely be created on the client using Javascript.) For brevity, the form has a single file input:
metabind
  • 175
  • 1
  • 4
4
votes
1 answer

Download wikipedia markup using Haskell

Using http-conduit I want to download the raw wikimedia markup for any page, for example the Wikipedia page Stack Overflow. Also, I'd like the solution to be applicable to wikimedia pages other than en.wikipedia.org, for example…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
3
votes
1 answer

Migrating from Network.HTTP.Enumerator to Network.HTTP.Conduit

I don't know why my code breaks. At first I thought it was because parseURL gives [] for the requestHeaders. Okay, so maybe I just need to tell it what the resquestHeaders should be. Well, I examined the requestHeaders generated from my old, working…
user1198582
1
2 3 4 5 6