Next: , Previous: , Up: URL remapping   [Contents]

9.2 URL handling

According to RFC2616, the methods include GET, POST, etc. However, because of the naming conflict, GNU Artanis provides the methods by this list:

In GNU Artanis the HEAD method is handled by the server, so you can’t define specific handlers directly for it within GNU Artanis.

Usage:

(method rule handler)

And the handler could be one of two types, depending on your needs:

(lambda ()
  ...
  ret)

(lambda (rc)
  ...
  ret)

ret also has two types:

(get "/hello" (lambda () "hello world"))

For a POST method:

(post "/auth" (lambda (rc) ...))