December 15, 2017, at 06:11 PM (0 comments)
The Set HTTP Headers PmWiki recipe is now installed on OborWiki (off by default; you can enable it via the Configurator). It allows you to specify, via a page directive, HTTP headers to be sent with a page.
The only feature of this recipe that’s available so far1 is the ability to set HTTP status codes. The markup is simple: (:httpstatus <some_status_code>:). The following status codes are currently available:
| Code | Header text |
|---|---|
| 200 | HTTP/1.1 200 OK |
| 201 | HTTP/1.1 201 Created |
| 202 | HTTP/1.1 202 Accepted |
| 204 | HTTP/1.1 204 No Content |
| 205 | HTTP/1.1 205 Reset Content |
| 400 | HTTP/1.1 400 Bad Request |
| 401 | HTTP/1.1 401 Unauthorized |
| 403 | HTTP/1.1 403 Forbidden |
| 404 | HTTP/1.1 404 Not Found |
| 405 | HTTP/1.1 405 Method Not Allowed |
| 406 | HTTP/1.1 406 Not Acceptable |
| 409 | HTTP/1.1 409 Conflict |
| 410 | HTTP/1.1 410 Gone |
| 412 | HTTP/1.1 412 Precondition Failed |
| 418 | HTTP/1.1 418 I'm a teapot |
| 423 | HTTP/1.1 423 Locked |
| 424 | HTTP/1.1 424 Failed Dependency |
| 429 | HTTP/1.1 429 Too Many Requests |
| 451 | HTTP/1.1 451 Unavailable For Legal Reasons |
| 500 | HTTP/1.1 500 Internal Server Error |
| 501 | HTTP/1.1 501 Not Implemented |
| 503 | HTTP/1.1 503 Service Unavailable |
Note that the (:httpstatus:) markup only sets the header; the page is otherwise rendered and sent as normal. It is up to you to display appropriate content, if need be (e.g., display some error message or descriptive text).
1 Future updates may add the ability to set other HTTP headers, and other customization features. ⇑