0

I tried to google my question before but i didn't found anything about how to check if a URL http status code is 404 or not by using scheme, so forgive me if my question can sound a little bit foreseen.

  • If you can use Chicken i recommend installing this [https-client egg](http://wiki.call-cc.org/eggref/4/http-client) – 138 Sep 24 '18 at 23:42
  • 1
    For guile, [these modules](https://www.gnu.org/software/guile/manual/html_node/Web.html#Web) probably have a way to do what you want. – Shawn Sep 25 '18 at 00:04

1 Answers1

2

From the web modules, use the (web response) and (web client) modules:

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

Note that if the host name cannot be resolved, this will signal an error.

Svante
  • 50,694
  • 11
  • 78
  • 122