Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(ql:quickload '(:clack :http-body))
(defvar *handler*)
(setf *handler*
(clack:clackup (lambda (env)
(if (eq (getf env :request-method) :get)
'(200 (:content-type :text-html)
("<html><head></head><body><form method='post' enctype='multipart/form-data'><input type='file' name='upload'><input type='submit' value='Upload'></form></body></html>"))
`(200 () (,(prin1-to-string (http-body:parse (getf env :content-type) (getf env :content-length) (getf env :raw-body)))))))
:server :woo))
@fukamachi

This comment has been minimized.

Copy link
Owner Author

commented Aug 17, 2018

Content BodyのパースでLack.Requestを使うバージョン

(ql:quickload :lack-request)

(defvar *handler*)

(setf *handler*
      (clack:clackup (lambda (env)
                       (if (eq (getf env :request-method) :get)
                           '(200 (:content-type :text-html)
                             ("<html><head></head><body><form method='post' enctype='multipart/form-data'><input type='file' name='upload'><input type='submit' value='Upload'></form></body></html>"))
                           `(200 () (,(prin1-to-string (lack.request:request-parameters
                                                        (lack.request:make-request env)))))))
                     :server :woo))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.