I'm using GHC 6.12.1 on Windows 7. I've built the latest Network
package using Haskell's MinGW and installed HTTP package on top of this.
The code below builds fine, but on execution it just sits there grabbing
ever increasing amounts of memory.
It's a simplified call that I've got working fine in Linux.
Is this a known issue? Anyone else had success using HTTP from Windows?
Thanks,
Phil.
import qualified Network.HTTP as HTTP
main :: IO ()
main
= do
x <- HTTP.simpleHTTP(HTTP.getRequest
"http://maps.google.com/maps/api/geocode/json?address=London&sensor=false")
print x
_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
The below works fine - I've changed the response type from json to
xml.... strange, but for some reason downloading json doesn't work....
it's fine on Linux.
I'm guessing this is more likely to be a Windows issue rather than a
Haskell issue - any ideas?
import qualified Network.HTTP as HTTP
main :: IO ()
main
= do
x <- getLocation
print x
getLocation = (HTTP.simpleHTTP $ HTTP.getRequest url) >>=
HTTP.getResponseBody
where
url =
"http://maps.google.com/maps/api/geocode/xml?address=London&sensor=false"
Scrap my original query - the problem isn't as black & white as I thought.
The below works fine - I've changed the response type from json to xml.... strange, but for some reason downloading json doesn't work.... it's fine on Linux.
I'm guessing this is more likely to be a Windows issue rather than a Haskell issue - any ideas?
On 16/03/2010 01:05, Phil wrote:A bit more testing - this is not a Windows issue per se. It seems to be a limitation of the HTTP library running on Windows.Scrap my original query - the problem isn't as black & white as I thought.
The below works fine - I've changed the response type from json to xml.... strange, but for some reason downloading json doesn't work.... it's fine on Linux.
I'm guessing this is more likely to be a Windows issue rather than a Haskell issue - any ideas?
I've ran what I consider to be identical commands (in terms of functional use, both perform a HTTP GET on the location given) in Haskell and Python from each of their consoles on the same computer. The Python one correctly returns exactly what the Haskell one does on Linux. The Haskell on Windows just hangs.....
However as mentioned earlier SOME http requests do work from Haskell so I don't think it's a problem with my build of HTTP or Network libs. The simplest example is to replace 'json' with 'xml' in the below query. The best guess I can make is that XML is deemed renderable, but for some reason JSON is considered to be binary/file data?
Can anyone confirm this behaviour.... I only have one 1 Windows PC, so I can't test on another machine. If it is a wide problem, I reckon it warrants a bug ticket on the library.....