有没有办法404在Rebol中读取非成功的http数据,例如a ?当open获取URL的非成功http响应代码时,它会因错误而失败,但我想读取响应.
我知道这很粗糙,但它适用于 Rebol 2。您可以使用以下命令获取 http 协议方案
h: get in system/schemes 'http
Run Code Online (Sandbox Code Playgroud)
然后你把它写入一个文件
write %ht mold h
Run Code Online (Sandbox Code Playgroud)
并编辑该文件。在那里你替换这条线
result: select either tunnel [tunnel-actions] [response-actions] response-code
Run Code Online (Sandbox Code Playgroud)
和
port/status: response-code
result: case [
tunnel [
select tunnel-actions response-code
]
not find response-actions response-code [
return response-code
]
true [
select response-actions response-code
]
]
Run Code Online (Sandbox Code Playgroud)
那么就必须更换原来的方案。添加
Rebol []
system/schemes/http:
到 ht 文件的开头并使用do %ht