![](/img/trans.png)
[英]Is it possible to implement the CONNECT HTTP method with the Snap framework?
[英]How to send an http request using snap-framework?
我想使用Snap框架向外部API發送http請求。 Snap支持嗎? 如果沒有,該怎么辦?
您是否看過使用Network.Wreq
?
import qualified Data.ByteString.Lazy as LAZ
import qualified Data.ByteString.Lazy.Char8 as CHA
makeRequest :: IO (Network.Wreq.Response LAZ.ByteString)
makeRequest = do
res <- get "https://www.example.com"
let resBody = res ^. responseBody :: CHA.ByteString
return (resBody)
使用簡單的鏡頭語法,並支持HTTP和HTTPS。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.