Haskell http-CONDUCTOR-1.9.4中的RequestHeader
我正在尝试使用自定义头创建http请求(使用http-CONDUCTOR-1.9.4):Haskell http-CONDUCTOR-1.9.4中的RequestHeader,haskell,http-request,Haskell,Http Request,我正在尝试使用自定义头创建http请求(使用http-CONDUCTOR-1.9.4): http管道根本不使用http包,它们是两种完全不同的方法。如果您查看文档,您将看到标题只是标题名称和值的元组 custom_header无法工作的唯一原因是您需要打开OverloadedStrings语言扩展。错误告诉您需要来自Network.HTTP.Types.header模块的头,而不是来自Network.HTTP.Headers我知道-我不知道如何创建Network.HTTP.Types.Head
http管道根本不使用http包,它们是两种完全不同的方法。如果您查看文档,您将看到
标题
只是标题名称和值的元组
custom_header
无法工作的唯一原因是您需要打开OverloadedStrings
语言扩展。错误告诉您需要来自Network.HTTP.Types.header
模块的头,而不是来自Network.HTTP.Headers
我知道-我不知道如何创建Network.HTTP.Types.Header对象,以及它与Network.HTTP.Headers.Header不同的原因
Couldn't match expected type `Network.HTTP.Types.Header.Header'
with actual type `Header'
In the expression: custom_header
In the `requestHeaders' field of a record
In the expression: req {requestHeaders = [custom_header]}
Couldn't match expected type `Network.HTTP.Types.Header.HeaderName'
with actual type `[Char]'
In the expression: "User-Agent"
In the expression: ("User-Agent", "erthalion")
In the `requestHeaders' field of a record