Blog »

New OborWiki feature: HTTP status directive

December 15, 2017, at 06:11 PM by Obormot in Updates, Features, Technical (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:

CodeHeader text
200HTTP/1.1 200 OK
201HTTP/1.1 201 Created
202HTTP/1.1 202 Accepted
204HTTP/1.1 204 No Content
205HTTP/1.1 205 Reset Content
400HTTP/1.1 400 Bad Request
401HTTP/1.1 401 Unauthorized
403HTTP/1.1 403 Forbidden
404HTTP/1.1 404 Not Found
405HTTP/1.1 405 Method Not Allowed
406HTTP/1.1 406 Not Acceptable
409HTTP/1.1 409 Conflict
410HTTP/1.1 410 Gone
412HTTP/1.1 412 Precondition Failed
418HTTP/1.1 418 I'm a teapot
423HTTP/1.1 423 Locked
424HTTP/1.1 424 Failed Dependency
429HTTP/1.1 429 Too Many Requests
451HTTP/1.1 451 Unavailable For Legal Reasons
500HTTP/1.1 500 Internal Server Error
501HTTP/1.1 501 Not Implemented
503HTTP/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.

Leave a reply
Your name (required):

Your comment (required):


Enter value: Captcha