Skip to content

Commit

Permalink
Merge pull request #131 from vindarel/master
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Jul 21, 2021
2 parents c67dcbb + dcb9e01 commit 39b356c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.markdown
Expand Up @@ -224,6 +224,23 @@ You can return following formats as the result of `defroute`.
* Pathname
* Clack's response list (containing Status, Headers and Body)

### Redirection

Redirect to another route with`(redirect "url")`. A second optional argument is the status code, 302 by default.

### Reverse URLs

When you defined routes with names, you can find the URL from a name with `(url-for route-name &rest params)`.

The function will throw an error if no route is found.

### More helper functions

See also:

- `add-query-parameters base-url params`


### Structured query/post parameters

Parameter keys containing square brackets ("[" & "]") will be parsed as structured parameters. You can access the parsed parameters as `_parsed` in routers.
Expand Down Expand Up @@ -415,7 +432,7 @@ There are several special variables available during a HTTP request. `*request*`
(http-referer *request*)
;; Set Content-Type header.
(setf (getf (response-headers *response* :content-type) "application/json")
(setf (getf (response-headers *response* :content-type) "application/json"))
;; Set HTTP status.
(setf (status *response*) 304)
Expand Down

0 comments on commit 39b356c

Please sign in to comment.