我是Haskel的新手,我正在尝试使用
http-conduit
,这是他们的
documentation
.
然而,在运行程序时,我总是得到:
⢠Couldn't match expected type âRequestâ with actual type â[Char]â
⢠In the first argument of âhttpLBSâ, namely
â"http://httpbin.org/get"â
In a stmt of a 'do' block:
response <- httpLBS "http://httpbin.org/get"
In the expression:
do response <- httpLBS "http://httpbin.org/get"
putStrLn
$ "The status code was: " ++ show (getResponseStatusCode response)
print $ getResponseHeader "Content-Type" response
L8.putStrLn $ getResponseBody response
|
12 | response <- httpLBS "http://httpbin.org/get"
| ^^^^^^^^^^^^^^^^^^^^^^^^
我试图创建一个既有阴谋集团又有stack的项目
http管道
和
aeson
作为依赖项,但仍然会出现错误。
url不应该隐式转换为
Request
?
我试着导入
要求
试着创造一个
要求
从url,但它抱怨:
import Network.HTTP.Client.Request
<no location info>: error:
Could not load module âNetwork.HTTP.Client.Requestâ
it is a hidden module in the package âhttp-client-0.6.4.1â