我之前尝试用谷歌搜索我的问题,但我没有找到任何关于如何使用方案检查 URL http 状态代码是否为 404 的信息,所以如果我的问题听起来有点预见性,请原谅我。
最佳答案
来自web modules , 使用 (web response)
和 (web client)
模块:
scheme@(guile-user)> (use-modules (web client))
scheme@(guile-user)> (use-modules (web response))
scheme@(guile-user)> (response-code (http-request "http://www.example.org"))
$3 = 200
请注意,如果无法解析主机名,则会发出错误信号。
关于http - 我如何通过 Guile Scheme 检查 URL 是否存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52486997/