The rfc2388 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The rfc2388 Reference Manual

This is the rfc2388 Reference Manual, version 1.5, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:32:04 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

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:

(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).


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 rfc2388

Author

Janis Dzerins <jonis@latnet.lv>

License

Simplified BSD

Description

Implementation of RFC 2388

Long Description

Contains an implementation of RFC 2388, which is used to process form data posted with HTTP POST method using enctype "multipart/form-data".

Version

1.5

Source

rfc2388.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Next: , Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 rfc2388.asd

Location

rfc2388.asd

Systems

rfc2388 (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 rfc2388/rfc2388.lisp

Dependency

packages.lisp (file)

Parent

rfc2388 (system)

Location

rfc2388.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.3 rfc2388/packages.lisp

Parent

rfc2388 (system)

Location

packages.lisp

Packages

rfc2388


Previous: , Up: Files   [Contents][Index]

3.2 Other


Previous: , Up: Other files   [Contents][Index]

3.2.1 rfc2388/rfc2388.asd

Parent

rfc2388 (system)

Location

rfc2388.asd


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 rfc2388

Source

packages.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: content-type PART &key AS-STRING

Returns the Content-Type header of mime-part PART.

Package

rfc2388

Source

rfc2388.lisp (file)

Function: find-content-disposition-header HEADERS
Package

rfc2388

Source

rfc2388.lisp (file)

Function: find-header LABEL HEADERS

Find header by label from set of headers.

Package

rfc2388

Source

rfc2388.lisp (file)

Function: find-parameter NAME PARAMS

Find header parameter by name from set of parameters.

Package

rfc2388

Source

rfc2388.lisp (file)

Function: get-file-name HEADERS
Package

rfc2388

Source

rfc2388.lisp (file)

Function: header-name STRUCTURE
Function: (setf header-name) VALUE STRUCTURE
Package

rfc2388

Source

rfc2388.lisp (file)

Function: header-parameters STRUCTURE
Function: (setf header-parameters) VALUE STRUCTURE
Package

rfc2388

Source

rfc2388.lisp (file)

Function: header-value STRUCTURE
Function: (setf header-value) VALUE STRUCTURE
Package

rfc2388

Source

rfc2388.lisp (file)

Function: make-mime-part CONTENTS HEADERS
Package

rfc2388

Source

rfc2388.lisp (file)

Function: mime-part-contents STRUCTURE
Function: (setf mime-part-contents) VALUE STRUCTURE
Package

rfc2388

Source

rfc2388.lisp (file)

Function: mime-part-headers STRUCTURE
Function: (setf mime-part-headers) VALUE STRUCTURE
Package

rfc2388

Source

rfc2388.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Generic functions

Generic Function: parse-header SOURCE &optional START-STATE

Parses SOURCE and returs a single MIME header.

Header is a list of the form (NAME VALUE PARAMETERS), PARAMETERS is a list of (NAME . VALUE)

Package

rfc2388

Source

rfc2388.lisp (file)

Methods
Method: parse-header (STREAM stream) &optional START-STATE

Returns a MIME part header, or NIL, if there is no header. Header is terminated by CRLF.

Method: parse-header (SOURCE string) &optional START-STATE
Generic Function: parse-mime SOURCE BOUNDARY &key WRITE-CONTENT-TO-FILE

Parses MIME entities, returning them as a list. Each element in the list is of form: (body headers), where BODY is the contents of MIME part, and HEADERS are all headers for that part. BOUNDARY is a string used to separate MIME entities.

Package

rfc2388

Source

rfc2388.lisp (file)

Methods
Method: parse-mime (INPUT stream) BOUNDARY &key WRITE-CONTENT-TO-FILE
Method: parse-mime (INPUT string) SEPARATOR &key WRITE-CONTENT-TO-FILE

Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: content-type-sub STRUCTURE
Function: (setf content-type-sub) VALUE STRUCTURE
Package

rfc2388

Source

rfc2388.lisp (file)

Function: content-type-super STRUCTURE
Function: (setf content-type-super) VALUE STRUCTURE
Package

rfc2388

Source

rfc2388.lisp (file)

Function: copy-content-type SEQUENCE

Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.

Package

rfc2388

Source

SYS:SRC;CODE;SEQ.LISP (not found)

Function: copy-header SEQUENCE

Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.

Package

rfc2388

Source

SYS:SRC;CODE;SEQ.LISP (not found)

Function: copy-mime-part SEQUENCE

Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.

Package

rfc2388

Source

SYS:SRC;CODE;SEQ.LISP (not found)

Function: lwsp-char-p CHAR

Returns true if CHAR is a linear-whitespace-char (LWSP-char). Either space or tab, in short.

Package

rfc2388

Source

rfc2388.lisp (file)

Function: make-content-type SUPER SUB
Package

rfc2388

Source

rfc2388.lisp (file)

Function: make-header NAME VALUE PARAMETERS
Package

rfc2388

Source

rfc2388.lisp (file)

Function: make-tmp-file-name ()
Package

rfc2388

Source

rfc2388.lisp (file)

Function: parse-content-type STRING

Returns content-type which is parsed from STRING.

Package

rfc2388

Source

rfc2388.lisp (file)

Function: read-until-next-boundary STREAM BOUNDARY &optional DISCARD OUT-STREAM

Reads from STREAM up to the next boundary. Returns two values: read data (nil if DISCARD is true), and true if the boundary is not last (i.e., there’s more data).

Package

rfc2388

Source

rfc2388.lisp (file)

Function: skip-linear-whitespace STRING &key START END

Returns the position of first non-linear-whitespace character in STRING bound by START and END.

Package

rfc2388

Source

rfc2388.lisp (file)

Function: unparse-content-type CT

Returns content-type CT in string representation.

Package

rfc2388

Source

rfc2388.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   O   R  
Index Entry  Section

F
File, Lisp, rfc2388.asd: The rfc2388<dot>asd file
File, Lisp, rfc2388/packages.lisp: The rfc2388/packages<dot>lisp file
File, Lisp, rfc2388/rfc2388.lisp: The rfc2388/rfc2388<dot>lisp file
File, other, rfc2388/rfc2388.asd: The rfc2388/rfc2388<dot>asd file

L
Lisp File, rfc2388.asd: The rfc2388<dot>asd file
Lisp File, rfc2388/packages.lisp: The rfc2388/packages<dot>lisp file
Lisp File, rfc2388/rfc2388.lisp: The rfc2388/rfc2388<dot>lisp file

O
Other File, rfc2388/rfc2388.asd: The rfc2388/rfc2388<dot>asd file

R
rfc2388.asd: The rfc2388<dot>asd file
rfc2388/packages.lisp: The rfc2388/packages<dot>lisp file
rfc2388/rfc2388.asd: The rfc2388/rfc2388<dot>asd file
rfc2388/rfc2388.lisp: The rfc2388/rfc2388<dot>lisp file

Jump to:   F   L   O   R  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
C   F   G   H   L   M   P   R   S   U  
Index Entry  Section

(
(setf content-type-sub): Internal functions
(setf content-type-super): Internal functions
(setf header-name): Exported functions
(setf header-parameters): Exported functions
(setf header-value): Exported functions
(setf mime-part-contents): Exported functions
(setf mime-part-headers): Exported functions

C
content-type: Exported functions
content-type-sub: Internal functions
content-type-super: Internal functions
copy-content-type: Internal functions
copy-header: Internal functions
copy-mime-part: Internal functions

F
find-content-disposition-header: Exported functions
find-header: Exported functions
find-parameter: Exported functions
Function, (setf content-type-sub): Internal functions
Function, (setf content-type-super): Internal functions
Function, (setf header-name): Exported functions
Function, (setf header-parameters): Exported functions
Function, (setf header-value): Exported functions
Function, (setf mime-part-contents): Exported functions
Function, (setf mime-part-headers): Exported functions
Function, content-type: Exported functions
Function, content-type-sub: Internal functions
Function, content-type-super: Internal functions
Function, copy-content-type: Internal functions
Function, copy-header: Internal functions
Function, copy-mime-part: Internal functions
Function, find-content-disposition-header: Exported functions
Function, find-header: Exported functions
Function, find-parameter: Exported functions
Function, get-file-name: Exported functions
Function, header-name: Exported functions
Function, header-parameters: Exported functions
Function, header-value: Exported functions
Function, lwsp-char-p: Internal functions
Function, make-content-type: Internal functions
Function, make-header: Internal functions
Function, make-mime-part: Exported functions
Function, make-tmp-file-name: Internal functions
Function, mime-part-contents: Exported functions
Function, mime-part-headers: Exported functions
Function, parse-content-type: Internal functions
Function, read-until-next-boundary: Internal functions
Function, skip-linear-whitespace: Internal functions
Function, unparse-content-type: Internal functions

G
Generic Function, parse-header: Exported generic functions
Generic Function, parse-mime: Exported generic functions
get-file-name: Exported functions

H
header-name: Exported functions
header-parameters: Exported functions
header-value: Exported functions

L
lwsp-char-p: Internal functions

M
make-content-type: Internal functions
make-header: Internal functions
make-mime-part: Exported functions
make-tmp-file-name: Internal functions
Method, parse-header: Exported generic functions
Method, parse-header: Exported generic functions
Method, parse-mime: Exported generic functions
Method, parse-mime: Exported generic functions
mime-part-contents: Exported functions
mime-part-headers: Exported functions

P
parse-content-type: Internal functions
parse-header: Exported generic functions
parse-header: Exported generic functions
parse-header: Exported generic functions
parse-mime: Exported generic functions
parse-mime: Exported generic functions
parse-mime: Exported generic functions

R
read-until-next-boundary: Internal functions

S
skip-linear-whitespace: Internal functions

U
unparse-content-type: Internal functions

Jump to:   (  
C   F   G   H   L   M   P   R   S   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   R   S  
Index Entry  Section

P
Package, rfc2388: The rfc2388 package

R
rfc2388: The rfc2388 system
rfc2388: The rfc2388 package

S
System, rfc2388: The rfc2388 system

Jump to:   P   R   S