HaskellにWebページが存在するかどうかを確認する方法を探しています。サーバーはHTTP2/HTTPSのみであり、サーバーントアプリケーションにページが存在するかどうかを確認しようとしています。HaskellでWebページのステータスコードを取得
ステータスコードが200か404かどうかを確認するためのドキュメントがあるHaskellパッケージはありますか?そして、強力なHTTPSとHTTP2サーバーで作業していますか?私は現在のhttp-導管と持っていますが、私は奇妙な例外を受けてるものをここで
(TlsExceptionHostPort(HandshakeFailed(Error_Protocolが( "ハローサーバーを期待して、警告を得た:[(AlertLevel_Fatal、HandshakeFailure)]"、真、HandshakeFailure))) "thibaud.dauce.fr" 443およびStatusCodeException)。
... other imports
import qualified Network.HTTP.Conduit as HTTP
... other types
type AppM = ReaderT Config (EitherT ServantErr IO)
newComment :: String -> OneComment -> AppM Int64
newComment baseUrl oneComment = do
time <- liftIO getCurrentTime
response <- HTTP.withManager $ \manager -> do
request <- HTTP.parseUrl $ url oneComment
HTTP.httpLbs request manager
case (statusIsSuccessful $ HTTP.responseStatus response, startswith baseUrl (url oneComment)) of
(_, False) -> return 0
(True, True) -> do
theNewComment <- runDb $ insert $ Comment (url oneComment) (content oneComment) time
return $ fromSqlKey theNewComment
_ -> return 0
を使用していくつかの例は[ 'wreq'パッケージ](http://www.serpentine.com/wreq/)を見てください – ErikR