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

9.2 URL handling

According to RFC2616, there’re GET, POST, PUT, PATCH and DELETE methods. You may register handler for specified URL rule to these methods.

There’d be HEAD method, but in GNU Artanis, HEAD method is handled by the server, users can’t use it.

The usage:

(method rule handler)

And the handler could be two types, depends on your need:

(lambda ()
  ...
  ret)

(lambda (rc)
  ...
  ret)

ret also has two types:

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

For POST method:

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