The trivial-http Reference Manual

Table of Contents

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

The trivial-http Reference Manual

This is the trivial-http Reference Manual, version 1.3.0, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:40:43 2018 GMT+0.


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

1 Systems

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


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

1.1 trivial-http

Author

Brian Mastenbrook and Gary King

License

MIT

Description

Simple support for HTTP GET, POST and more.

Version

1.3.0

Dependency

usocket

Source

trivial-http.asd (file)

Component

dev (module)


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

2 Modules

Modules are listed depth-first from the system components tree.


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

2.1 trivial-http/dev

Parent

trivial-http (system)

Location

dev/

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 trivial-http.asd

Location

trivial-http.asd

Systems

trivial-http (system)

Packages

trivial-http-system


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

3.1.2 trivial-http/dev/package.lisp

Parent

dev (module)

Location

dev/package.lisp

Packages

trivial-http


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

3.1.3 trivial-http/dev/variables.lisp

Dependency

package.lisp (file)

Parent

dev (module)

Location

dev/variables.lisp

Exported Definitions
Internal Definitions

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

3.1.4 trivial-http/dev/trivial-http.lisp

Dependency

variables.lisp (file)

Parent

dev (module)

Location

dev/trivial-http.lisp

Exported Definitions
Internal Definitions

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

3.1.5 trivial-http/dev/base64.lisp

Dependency

variables.lisp (file)

Parent

dev (module)

Location

dev/base64.lisp

Internal Definitions

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

3.2 Other


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

3.2.1 trivial-http/dev/notes.text

Parent

dev (module)

Location

dev/notes.text


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

4 Packages

Packages are listed by definition order.


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

4.1 trivial-http-system

Source

trivial-http.asd

Use List

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

4.2 trivial-http

trivial-http is a simple networking library for doing HTTP POST
and GET over a socket interface. It establishes a package trivial-http, also called SHTTP, from which the following functions are exported: http-get, http-post, escape-url-query and http-head.

Source

package.lisp (file)

Nickname

shttp

Use List
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 Special variables

Special Variable: *http-debug*
Package

trivial-http

Source

variables.lisp (file)

Special Variable: *user-agent*
Package

trivial-http

Source

variables.lisp (file)


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

5.1.2 Functions

Function: escape-url-query QUERY

Escapes a query string in accordance with the HTTP specification.

Package

trivial-http

Source

trivial-http.lisp (file)

Function: header-pair NAME HEADERS

Searches headers for name _without_ case sensitivity. Headers should be an alist mapping symbols to values; name a symbol. Returns the (name value) pair if name is found or nil if it is not.

Package

trivial-http

Source

trivial-http.lisp (file)

Function: header-value NAME HEADERS

Searchers headers for name _without_ case sensitivity. Headers should be an alist mapping symbols to values; name a symbol. Returns the value if name is found or nil if it is not.

Package

trivial-http

Source

trivial-http.lisp (file)

Function: http-download URL DESTINATION &key SIGNAL-ERROR?

Resolves ‘url‘ using http-resolve and downloads the contents of the stream it to ‘destination‘. Destination is assumed to be a file. Returns (as multiple values) the number of elements downloaded (e.g., bytes) and the actual URL.

Package

trivial-http

Source

trivial-http.lisp (file)

Function: http-get URL

returns a list of three elements: a response code as integer, an association list of headers returned from the server, and a stream from which the response can be read.

Package

trivial-http

Source

trivial-http.lisp (file)

Function: http-head URL

Returns a list of two elements: a response code as an integer and an association list of headers returned from the server.

Package

trivial-http

Source

trivial-http.lisp (file)

Function: http-post URL CONTENT-TYPE CONTENT &key HEADERS DEBUG?

given a URL, a MIME content type, and the content as a character stream, POST to the URL and return the list of three elements as described for [http-get][].

Package

trivial-http

Source

trivial-http.lisp (file)

Function: http-resolve URL &key HTTP-METHOD SIGNAL-ERROR? VERBOSE?

Similar to [http-get][], ‘http-resolve‘ returns a list of four elements: the HTTP response code, the headers, the stream
and the resolved URL. HTTP-response resolves 301 and 302 responses, and signals an error on responses greater
than 400. If there is not an error, then the caller is responsible for closing the HTTP stream.

Package

trivial-http

Source

trivial-http.lisp (file)


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

5.1.3 Generic functions

Generic Function: download-command CONDITION
Package

trivial-http

Methods
Method: download-command (CONDITION download-error)
Source

trivial-http.lisp (file)

Generic Function: download-length-claimed CONDITION
Package

trivial-http

Methods
Method: download-length-claimed (CONDITION mismatched-download-size-error)
Source

trivial-http.lisp (file)

Generic Function: download-length-downloaded CONDITION
Package

trivial-http

Methods
Method: download-length-downloaded (CONDITION mismatched-download-size-error)
Source

trivial-http.lisp (file)

Generic Function: download-response CONDITION
Package

trivial-http

Methods
Method: download-response (CONDITION download-error)
Source

trivial-http.lisp (file)

Generic Function: download-url CONDITION
Package

trivial-http

Methods
Method: download-url (CONDITION download-error)
Source

trivial-http.lisp (file)

Generic Function: stream-from CONDITION
Package

trivial-http

Methods
Method: stream-from (CONDITION incompatible-stream-error)
Source

trivial-http.lisp (file)

Generic Function: stream-to CONDITION
Package

trivial-http

Methods
Method: stream-to (CONDITION incompatible-stream-error)
Source

trivial-http.lisp (file)


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

5.1.4 Conditions

Condition: download-error ()
Package

trivial-http

Source

trivial-http.lisp (file)

Direct superclasses

trivial-http-error (condition)

Direct subclasses

mismatched-download-size-error (condition)

Direct methods
Direct slots
Slot: url
Initargs

:url

Initform

(quote "?")

Readers

download-url (generic function)

Slot: command
Initargs

:command

Initform

(quote "?")

Readers

download-command (generic function)

Slot: response
Initargs

:response

Initform

(quote "?")

Readers

download-response (generic function)

Condition: incompatible-stream-error ()
Package

trivial-http

Source

trivial-http.lisp (file)

Direct superclasses

trivial-http-error (condition)

Direct methods
Direct slots
Slot: from
Initargs

:from

Readers

stream-from (generic function)

Slot: to
Initargs

:to

Readers

stream-to (generic function)

Condition: mismatched-download-size-error ()
Package

trivial-http

Source

trivial-http.lisp (file)

Direct superclasses

download-error (condition)

Direct methods
Direct slots
Slot: length-claimed
Initargs

:length-claimed

Readers

download-length-claimed (generic function)

Slot: length-downloaded
Initargs

:length-downloaded

Readers

download-length-downloaded (generic function)


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

5.2 Internal definitions


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

5.2.1 Constants

Constant: +crlf+
Package

trivial-http

Source

trivial-http.lisp (file)


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

5.2.2 Special variables

Special Variable: *encode-table*
Package

trivial-http

Source

base64.lisp (file)

Special Variable: *proxy-password*
Package

trivial-http

Source

variables.lisp (file)

Special Variable: *proxy-user*
Package

trivial-http

Source

variables.lisp (file)

Special Variable: *stream-buffer-size*
Package

trivial-http

Source

trivial-http.lisp (file)


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

5.2.3 Functions

Function: base64-encode ()
Package

trivial-http

Source

base64.lisp (file)

Function: copy-stream FROM TO

Copy into TO from FROM until end of the input stream, in blocks of *stream-buffer-size*. The streams should have the same element type. Returns the total number of ’elements’ read and written.

Package

trivial-http

Source

trivial-http.lisp (file)

Function: download-stream STREAM DESTINATION &key EXPECTED-LENGTH
Package

trivial-http

Source

trivial-http.lisp (file)

Function: open-file-arguments ()
Package

trivial-http

Source

trivial-http.lisp (file)

Function: response-read-code STREAM
Package

trivial-http

Source

trivial-http.lisp (file)

Function: response-read-headers STREAM
Package

trivial-http

Source

trivial-http.lisp (file)

Function: url-host URL
Package

trivial-http

Source

trivial-http.lisp (file)

Function: url-path URL
Package

trivial-http

Source

trivial-http.lisp (file)

Function: url-port URL
Package

trivial-http

Source

trivial-http.lisp (file)

Function: url-reserved-character-p C
Package

trivial-http

Source

trivial-http.lisp (file)

Function: write-additional-headers STREAM
Package

trivial-http

Source

trivial-http.lisp (file)

Function: write-crlf STREAM
Package

trivial-http

Source

trivial-http.lisp (file)

Function: write-standard-headers COMMAND URL HOST STREAM
Package

trivial-http

Source

trivial-http.lisp (file)


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

5.2.4 Conditions

Condition: trivial-http-error ()
Package

trivial-http

Source

trivial-http.lisp (file)

Direct superclasses

error (condition)

Direct subclasses

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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   M   O   T  
Index Entry  Section

F
File, Lisp, trivial-http.asd: The trivial-http<dot>asd file
File, Lisp, trivial-http/dev/base64.lisp: The trivial-http/dev/base64<dot>lisp file
File, Lisp, trivial-http/dev/package.lisp: The trivial-http/dev/package<dot>lisp file
File, Lisp, trivial-http/dev/trivial-http.lisp: The trivial-http/dev/trivial-http<dot>lisp file
File, Lisp, trivial-http/dev/variables.lisp: The trivial-http/dev/variables<dot>lisp file
File, other, trivial-http/dev/notes.text: The trivial-http/dev/notes<dot>text file

L
Lisp File, trivial-http.asd: The trivial-http<dot>asd file
Lisp File, trivial-http/dev/base64.lisp: The trivial-http/dev/base64<dot>lisp file
Lisp File, trivial-http/dev/package.lisp: The trivial-http/dev/package<dot>lisp file
Lisp File, trivial-http/dev/trivial-http.lisp: The trivial-http/dev/trivial-http<dot>lisp file
Lisp File, trivial-http/dev/variables.lisp: The trivial-http/dev/variables<dot>lisp file

M
Module, trivial-http/dev: The trivial-http/dev module

O
Other File, trivial-http/dev/notes.text: The trivial-http/dev/notes<dot>text file

T
trivial-http.asd: The trivial-http<dot>asd file
trivial-http/dev: The trivial-http/dev module
trivial-http/dev/base64.lisp: The trivial-http/dev/base64<dot>lisp file
trivial-http/dev/notes.text: The trivial-http/dev/notes<dot>text file
trivial-http/dev/package.lisp: The trivial-http/dev/package<dot>lisp file
trivial-http/dev/trivial-http.lisp: The trivial-http/dev/trivial-http<dot>lisp file
trivial-http/dev/variables.lisp: The trivial-http/dev/variables<dot>lisp file

Jump to:   F   L   M   O   T  

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

A.2 Functions

Jump to:   B   C   D   E   F   G   H   M   O   R   S   U   W  
Index Entry  Section

B
base64-encode: Internal functions

C
copy-stream: Internal functions

D
download-command: Exported generic functions
download-command: Exported generic functions
download-length-claimed: Exported generic functions
download-length-claimed: Exported generic functions
download-length-downloaded: Exported generic functions
download-length-downloaded: Exported generic functions
download-response: Exported generic functions
download-response: Exported generic functions
download-stream: Internal functions
download-url: Exported generic functions
download-url: Exported generic functions

E
escape-url-query: Exported functions

F
Function, base64-encode: Internal functions
Function, copy-stream: Internal functions
Function, download-stream: Internal functions
Function, escape-url-query: Exported functions
Function, header-pair: Exported functions
Function, header-value: Exported functions
Function, http-download: Exported functions
Function, http-get: Exported functions
Function, http-head: Exported functions
Function, http-post: Exported functions
Function, http-resolve: Exported functions
Function, open-file-arguments: Internal functions
Function, response-read-code: Internal functions
Function, response-read-headers: Internal functions
Function, url-host: Internal functions
Function, url-path: Internal functions
Function, url-port: Internal functions
Function, url-reserved-character-p: Internal functions
Function, write-additional-headers: Internal functions
Function, write-crlf: Internal functions
Function, write-standard-headers: Internal functions

G
Generic Function, download-command: Exported generic functions
Generic Function, download-length-claimed: Exported generic functions
Generic Function, download-length-downloaded: Exported generic functions
Generic Function, download-response: Exported generic functions
Generic Function, download-url: Exported generic functions
Generic Function, stream-from: Exported generic functions
Generic Function, stream-to: Exported generic functions

H
header-pair: Exported functions
header-value: Exported functions
http-download: Exported functions
http-get: Exported functions
http-head: Exported functions
http-post: Exported functions
http-resolve: Exported functions

M
Method, download-command: Exported generic functions
Method, download-length-claimed: Exported generic functions
Method, download-length-downloaded: Exported generic functions
Method, download-response: Exported generic functions
Method, download-url: Exported generic functions
Method, stream-from: Exported generic functions
Method, stream-to: Exported generic functions

O
open-file-arguments: Internal functions

R
response-read-code: Internal functions
response-read-headers: Internal functions

S
stream-from: Exported generic functions
stream-from: Exported generic functions
stream-to: Exported generic functions
stream-to: Exported generic functions

U
url-host: Internal functions
url-path: Internal functions
url-port: Internal functions
url-reserved-character-p: Internal functions

W
write-additional-headers: Internal functions
write-crlf: Internal functions
write-standard-headers: Internal functions

Jump to:   B   C   D   E   F   G   H   M   O   R   S   U   W  

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

A.3 Variables

Jump to:   *   +  
C   F   L   R   S   T   U  
Index Entry  Section

*
*encode-table*: Internal special variables
*http-debug*: Exported special variables
*proxy-password*: Internal special variables
*proxy-user*: Internal special variables
*stream-buffer-size*: Internal special variables
*user-agent*: Exported special variables

+
+crlf+: Internal constants

C
command: Exported conditions
Constant, +crlf+: Internal constants

F
from: Exported conditions

L
length-claimed: Exported conditions
length-downloaded: Exported conditions

R
response: Exported conditions

S
Slot, command: Exported conditions
Slot, from: Exported conditions
Slot, length-claimed: Exported conditions
Slot, length-downloaded: Exported conditions
Slot, response: Exported conditions
Slot, to: Exported conditions
Slot, url: Exported conditions
Special Variable, *encode-table*: Internal special variables
Special Variable, *http-debug*: Exported special variables
Special Variable, *proxy-password*: Internal special variables
Special Variable, *proxy-user*: Internal special variables
Special Variable, *stream-buffer-size*: Internal special variables
Special Variable, *user-agent*: Exported special variables

T
to: Exported conditions

U
url: Exported conditions

Jump to:   *   +  
C   F   L   R   S   T   U  

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

A.4 Data types

Jump to:   C   D   I   M   P   S   T  
Index Entry  Section

C
Condition, download-error: Exported conditions
Condition, incompatible-stream-error: Exported conditions
Condition, mismatched-download-size-error: Exported conditions
Condition, trivial-http-error: Internal conditions

D
download-error: Exported conditions

I
incompatible-stream-error: Exported conditions

M
mismatched-download-size-error: Exported conditions

P
Package, trivial-http: The trivial-http package
Package, trivial-http-system: The trivial-http-system package

S
System, trivial-http: The trivial-http system

T
trivial-http: The trivial-http system
trivial-http: The trivial-http package
trivial-http-error: Internal conditions
trivial-http-system: The trivial-http-system package

Jump to:   C   D   I   M   P   S   T