File: README.md

package info (click to toggle)
acl2 8.3dfsg-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 309,408 kB
  • sloc: lisp: 3,311,842; javascript: 22,569; cpp: 9,029; ansic: 7,872; perl: 6,501; xml: 3,838; java: 3,738; makefile: 3,383; ruby: 2,633; sh: 2,489; ml: 763; python: 741; yacc: 721; awk: 260; csh: 186; php: 171; lex: 154; tcl: 49; asm: 23; haskell: 17
file content (32 lines) | stat: -rw-r--r-- 1,468 bytes parent folder | download | duplicates (8)
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
This package contains an implementation of RFC 2388, which is used to
process form data posted with HTTP POST method using enctype
"multipart/form-data".

The main functions of interest are PARSE-MIME and PARSE-HEADER.

Use PARSE-MIME to parse MIME content. It can be given either a string
or a stream. It returns a list of MIME parts. The second argument must
be a boundary, which is a string that seperates MIME parts. See below
how to obtain it.

PARSE-HEADER is used by PARSE-MIME internally, but you can use it to
parse headers yourself. For instance, when data is posted to server
using POST method, a header describing the content type is sent as
well. Usually its content is application/x-www-form-urlencoded or
something similar. But users may set it to multipart/form-data, with
additional parameter named "boundary". This is how one would usually
parse the posted data:

```lisp
(let* ((header (parse-header <request-content-type> :value))
       (boundary (or (assoc "boundary" (header-parameters header)
                            :test #'string-equal)
                     (error "Form data is missing a boundary: ~S"
                            <request-content-type>))))
  (parse-mime <request-posted-content> boundary))
```
      
The :VALUE keyword parameter to PARSE-HEADER means that parsing should
begin with header value, not name (because header name is
"content-type" and the web server has already seperated them, at least
in this scenario).