1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <title>Description of rfc2388
</title>
8 <h1>An implementation of RFC
2388 in Common Lisp
</h1>
10 <p> This
<i>package
</i> contains an implementation of
11 RFC
2388, which is used to process form data posted with HTTP
12 POST method using enctype
"multipart/form-data".
</p>
14 <p> The main functions of interest are
<tt>PARSE-MIME
</tt> and
15 <tt>PARSE-HEADER
</tt>.
</p>
17 <p> Use
<tt>PARSE-MIME
</tt> to parse MIME content. It can be
18 given either a
<tt>string
</tt> or a
<tt>stream
</tt>. It returns a
19 list of MIME parts. The second argument must be a boundary, which
20 is a string that seperates MIME parts. See below how to obtain it.
</p>
22 <p> <tt>PARSE-HEADER
</tt> is used by
<tt>PARSE-MIME
</tt>
23 internally, but you can use it to parse headers yourself. For
24 instance, when data is posted to server using POST method, a
25 header describing the content type is sent as well. Usually its
26 content is
<tt>application/x-www-form-urlencoded
</tt> or something
27 similar. But users may set it to
<tt>multipart/form-data
</tt>,
28 with additional parameter named
"boundary". This is how one would
29 usually parse the posted data:
31 (let* ((header (parse-header
<request-content-type
> :value))
32 (boundary (or (assoc
"boundary" (header-parameters header)
34 (error
"Form data is missing a boundary: ~S"
35 <request-content-type
>))))
36 (parse-mime
<request-posted-content
> boundary))
39 The
<tt>:VALUE
</tt> keyword parameter to
<tt>PARSE-HEADER
</tt>
40 means that parsing should begin with header value, not name
41 (because header name is
"content-type" and the web server has
42 already seperated them, at least in this scenario).
46 Get the latest code
<a
47 href=
"http://common-lisp.net/project/rfc2388/rfc2388_latest.tar.gz"
52 <address><a href=
"mailto:(do)jonis(not)@(spam)latnet(me).(please)lv">Janis Dzerins
</a></address>
53 <!-- Created: Fri Aug 29 21:41:24 EEST 2003 -->