http - 我如何通过 Guile Scheme 检查 URL 是否存在?

标签 http scheme lisp guile

我之前尝试用谷歌搜索我的问题,但我没有找到任何关于如何使用方案检查 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/

相关文章:

list - 如何在 Racket 中创建一个可以按照添加元素的顺序进行迭代的列表?

web - 什么是 restas 渲染对象?

git push origin master 导致 fatal error

laravel - 在 Laravel 中处理文本/纯文本请求(通过 navigator.sendBeacon 发送)

c# - DELETE 方法似乎什么都不做

functional-programming - Lisp - 逻辑运算符

lisp - John McCarthy 所说的*色情节目*是什么意思?

http - 把自己限制在HTTP1.0有什么用吗?

scheme - Scheme R7RS中load和include的区别

Scheme 中的宏和内部定义