Is there a way to read non success http data, for example for a 404
, in Rebol? When open
gets a non success http response code for an URL it fails with an error, but I would like to read the response instead.
I know this is crude, but it works for Rebol 2. You can get the http protocol scheme with
h: get in system/schemes 'http
then you write it to a file
write %ht mold h
and edit this file. There you replace this line
result: select either tunnel [tunnel-actions] [response-actions] response-code
with
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
]
]
Then you have to replace the original scheme. AddRebol []
system/schemes/http:
at the beginnung of your ht-file and do it with do %ht
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With