-
Notifications
You must be signed in to change notification settings - Fork 1
/
hunchentoot-server.lisp
46 lines (35 loc) · 1.44 KB
/
hunchentoot-server.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(in-package :webserver)
(defun (setf return-code*) (code)
"Sets the return code."
(setf (hunchentoot:return-code*) code))
(defun header-in* (header)
"Retrieves the input header."
(hunchentoot:header-in* header))
(defun (setf header-out) (value header)
"Sets one of the headers for the response."
(setf (hunchentoot:header-out header) value))
(defun get-parameter (parameter)
"Retrieves the supplied get-parameter."
(hunchentoot:get-parameter parameter))
(defun get-parameters ())
(defun get-parameters* ()
"Retrieves all get parameters"
(hunchentoot:get-parameters*))
(defun script-name* ()
"Retrieves the URI without the request parameters"
(hunchentoot:script-name*))
(defun post-body ()
"Retrieves the current post-body and parses it as text."
(hunchentoot:raw-post-data :external-format :utf8 :force-text t))
(defun request-method* ()
"Retrieves the request method of the current request."
(hunchentoot:request-method*))
(defun (setf content-type*) (content-type)
"Sets the content-type of the response."
(setf (hunchentoot:content-type*) content-type))
(defconstant +http-no-content+ hunchentoot:+http-no-content+)
(defconstant +http-not-found+ hunchentoot:+http-not-found+)
(defconstant +http-not-acceptable+ hunchentoot:+http-not-acceptable+)
(defconstant +http-forbidden+ hunchentoot:+http-forbidden+)
(defconstant +http-conflict+ hunchentoot:+http-conflict+)
(defconstant +http-created+ hunchentoot:+http-created+)