updated on Fri Jan 6 08:01:17 UTC 2012
[aur-mirror.git] / cl-rfc2388 / doc.html
blob009f11a98afeb0222ae66e36658ed7d5bec553b8
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <title>Description of rfc2388</title>
5 </head>
7 <body>
8 <h1>An implementation of RFC&nbsp;2388 in Common Lisp</h1>
10 <p> This <i>package</i> contains an implementation of
11 RFC&nbsp;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:
30 <pre>
31 (let* ((header (parse-header &lt;request-content-type&gt; :value))
32 (boundary (or (assoc "boundary" (header-parameters header)
33 :test #'string-equal)
34 (error "Form data is missing a boundary: ~S"
35 &lt;request-content-type&gt;))))
36 (parse-mime &lt;request-posted-content&gt; boundary))
37 </pre>
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).
43 </p>
45 <p>
46 Get the latest code <a
47 href="http://common-lisp.net/project/rfc2388/rfc2388_latest.tar.gz"
48 >here</a>.
49 </p>
51 <hr>
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 -->
54 </body>
55 </html>