Debian Codegraph @

docs/index.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
2 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta><title>Drakma - A Common Lisp HTTP client</title><meta name="description" content="
3 Drakma is a full-featured HTTP client implemented in Common Lisp.
4 It knows how to handle HTTP/1.1 chunking,
5 persistent connections, re-usable sockets, SSL, continuable uploads, file uploads, cookies, and more.
6 "></meta><style type="text/css">
7 body { background-color: #ffffff }
8 pre { padding:5px; background-color:#e0e0e0 }
9 pre.none { padding:5px; background-color:#ffffff }
10 h3, h4, h5 { text-decoration: underline; }
11 .entry-type { padding-left: 1em; font-size: 60%; font-style: italic }
12 a { text-decoration: none; padding: 1px 2px 1px 2px; }
13 a:visited { text-decoration: none; padding: 1px 2px 1px 2px; }
14 a:hover { text-decoration: none; padding: 1px 1px 1px 1px; border: 1px solid #000000; }
15 a:focus { text-decoration: none; padding: 1px 2px 1px 2px; border: none; }
16 a.none { text-decoration: none; padding: 0; }
17 a.none:visited { text-decoration: none; padding: 0; }
18 a.none:hover { text-decoration: none; border: none; padding: 0; }
19 a.none:focus { text-decoration: none; border: none; padding: 0; }
20 a.noborder { text-decoration: none; padding: 0; }
21 a.noborder:visited { text-decoration: none; padding: 0; }
22 a.noborder:hover { text-decoration: none; border: none; padding: 0; }
23 a.noborder:focus { text-decoration: none; border: none; padding: 0; }
24 </style></head><body>
25
26
27
28 <h2>Drakma - A Common Lisp HTTP client</h2>
29
30 <blockquote>
31 <h3 xmlns=""><a class="none" name="abstract">Abstract</a></h3>
32 <p>
33 Drakma is a full-featured HTTP client implemented in Common
34 Lisp. It knows how to handle <a href="#chunked">HTTP/1.1
35 chunking</a>, <a href="#arg-keep-alive">persistent
36 connections</a>, <a href="#ex-reuse-connection">re-usable
37 sockets</a>, <a href="#ex-chunked-https">SSL</a>, <a href="#ex-assemble-request-content">continuable uploads</a>,
38 <a href="#arg-parameters">file uploads</a>, <a href="#arg-cookie-jar">cookies</a>, and more.
39 </p>
40 <p>
41 The code comes with a <a href="http://www.opensource.org/licenses/bsd-license.php">BSD-style
42 license</a> so you can basically do with it whatever you want.
43 </p>
44
45 </blockquote>
46
47 <h3 xmlns=""><a class="none" name="contents">Contents</a></h3>
48 <ol xmlns="">
49 <li><a href="#abstract">Abstract</a></li>
50 <li><a href="#contents">Contents</a></li>
51 <li>
52 <a href="#examples">Examples</a><ol>
53 <li><a href="#ex-loading">Loading Drakma with Quicklisp</a></li>
54 <li><a href="#ex-logging">Log headers to the REPL output stream</a></li>
55 <li><a href="#ex-request-redirect">Requesting a page with redirection</a></li>
56 <li><a href="#ex-charsets">Requesting a page containing non-ASCII characters</a></li>
57 <li><a href="#ex-binary-data">Requesting binary data</a></li>
58 <li><a href="#ex-chunked-https">Chunked transfers and HTTPS</a></li>
59 <li><a href="#ex-fake-ua">Faking a user agent header</a></li>
60 <li><a href="#ex-post-and-cookie">Posting data and using cookies</a></li>
61 <li><a href="#ex-reuse-connection">Reusing a connection to a server</a></li>
62 <li><a href="#ex-basic-auth">Basic Authorization</a></li>
63 <li><a href="#ex-response-stream">Reading the response from a stream</a></li>
64 <li><a href="#ex-assemble-request-content">Piecemeal assembly of request contents</a></li>
65 <li><a href="#ex-partial-transfers">Partial transfers</a></li>
66 </ol>
67 </li>
68 <li><a href="#install">Download and Installation</a></li>
69 <li><a href="#patches">Development and patches</a></li>
70 <li>
71 <a href="#dictionary">The Drakma dictionary</a><ol>
72 <li><a href="#dict-request">Requests</a></li>
73 <li><a href="#headers">Headers</a></li>
74 <li><a href="#cookies">Cookies</a></li>
75 <li><a href="#conditions">Conditions</a></li>
76 </ol>
77 </li>
78 <li><a href="#index">Symbol index</a></li>
79 </ol>
80
81 <h3 xmlns=""><a class="none" name="examples">Examples</a></h3>
82
83 <style type="text/css">
84 body { margin-left: 2em; }
85 p, blockquote { max-width: 45em; }
86 pre { margin-left: 3em; margin-right: 3em; word-wrap: break-word; overflow-x: auto; background: #eee; }
87 .arglist-spacer { margin-left: 6em; max-width: 45em; }
88 .repl-output { color: black; }
89 .repl-input { font-weight: bold; }
90 .headers-out { color: SteelBlue; }
91 .headers-in { color: SeaGreen; }
92 </style>
93
94 <p>
95 Here is a collection of example uses of Drakma to which
96 demonstrate some of its features. In the examples, text is
97 color coded to indicate where it comes from (<tt><span class="repl-input">REPL input</span>, <span class="repl-output">REPL output</span>, <span class="headers-out">HTTP headers sent</span></tt> and <tt><span class="headers-in">HTTP headers received</span></tt>). Headers
98 particularly relevant to the example at hand are shown <tt><span class="headers-out"><b>in</b></span> <span class="headers-in"><b>bold</b></span></tt>.
99 </p>
100
101 <h4 xmlns=""><a name="ex-loading">Loading Drakma with Quicklisp</a></h4>
102 <pre><span class="repl-output">? </span><span class="repl-input">(ql:quickload :drakma)</span>
103 <span class="repl-output">To load "drakma":
104 Load 1 ASDF system:
105 drakma
106 ; Loading "drakma"
107 To load "cl+ssl":
108 Load 1 ASDF system:
109 flexi-streams
110 Install 8 Quicklisp releases:
111 alexandria babel bordeaux-threads cffi cl+ssl
112 trivial-features trivial-garbage trivial-gray-streams
113 ...
114 ; Loading "drakma"
115
116 (:DRAKMA)
117 </span>
118 </pre>
119
120 <h4 xmlns=""><a name="ex-logging">Log headers to the REPL output stream</a></h4>
121 <p>
122 In some of the following examples, the headers exchanged
123 between Drakma and the HTTP server should be shown, for
124 illustration purposes. This can be achieved like so:
125 </p>
126 <pre><span class="repl-output">? </span><span class="repl-input">(setf drakma:*header-stream* *standard-output*)</span>
127 <span class="repl-output">#&lt;SYNONYM-STREAM to *TERMINAL-IO* #x3020006AC7DD&gt;</span>
128 </pre>
129
130 <h4 xmlns=""><a name="ex-request-redirect">Requesting a page with redirection</a></h4>
131 <p>
132 Request a page. Note how Drakma automatically follows the 301
133 redirect and how the fourth return value shows the
134 <em>new</em> URI.
135 </p>
136 <pre><span class="repl-output">? </span><span class="repl-input">(<a href="#http-request">drakma:http-request</a> "http://lisp.org/")</span>
137 <span class="headers-out">GET / HTTP/1.1
138 Host: lisp.org
139 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
140 Accept: */*
141 Connection: close
142 </span>
143 <span class="headers-in">HTTP/1.1 <b>307 Temporary Redirect</b>
144 Date: Sun, 09 Dec 2012 08:01:56 GMT
145 Connection: Close
146 Server: AllegroServe/1.2.65
147 Transfer-Encoding: chunked
148 <b>LOCATION: http://lisp.org/index.html</b>
149 </span>
150 <span class="headers-out"><b>GET /index.html HTTP/1.1</b>
151 Host: lisp.org
152 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
153 Accept: */*
154 Connection: close
155 </span>
156 <span class="headers-in">HTTP/1.1 200 OK
157 Date: Sun, 09 Dec 2012 08:01:56 GMT
158 Connection: Close
159 Server: AllegroServe/1.2.65
160 Content-Type: text/html
161 Content-Length: 459
162 LAST-MODIFIED: Wed, 26 Oct 2011 02:26:26 GMT
163 </span>
164 <span class="repl-output">"&lt;HTML&gt;
165 &lt;HEAD&gt;
166 &lt;title&gt;John McCarthy, 1927-2011&lt;/title&gt;
167 &lt;STYLE type=\"text/css\"&gt;
168 BODY {text-align: center}
169 &lt;/STYLE&gt;
170 &lt;/HEAD&gt;
171 &lt;BODY&gt;
172 &lt;h1&gt;John McCarthy&lt;/h1&gt;
173 &lt;img src=\"jmccolor.jpg\" alt=\"a picture of John McCarthy, from his website\"/&gt;
174 &lt;h3&gt;1927-2011&lt;/h3&gt;
175 &lt;br&gt;&lt;br&gt;
176 &lt;a href=\"http://www-formal.stanford.edu/jmc/\"&gt;John McCarthy's Home Page&lt;/a&gt;&lt;br&gt;
177 &lt;a href=\"http://news.stanford.edu/news/2011/october/john-mccarthy-obit-102511.html\"&gt;Obituary&lt;/a&gt;
178 &lt;/BODY&gt;
179 &lt;/HTML&gt;
180 "
181 200
182 ((:DATE . "Sun, 09 Dec 2012 08:01:56 GMT") (:CONNECTION . "Close") (:SERVER . "AllegroServe/1.2.65")
183 (:CONTENT-TYPE . "text/html") (:CONTENT-LENGTH . "459") (:LAST-MODIFIED . "Wed, 26 Oct 2011 02:26:26 GMT"))
184 #&lt;URI http://lisp.org/index.html&gt;
185 #&lt;FLEXI-STREAMS:FLEXI-IO-STREAM #x30200155DB1D&gt;
186 T
187 " OK"</span>
188 </pre>
189
190 <h4 xmlns=""><a name="ex-charsets">Requesting a page containing non-ASCII characters</a></h4>
191 <p>
192 Drakma automatically interprets the 'charset=utf-8' part
193 correctly.
194 </p>
195 <pre><span class="repl-output">? </span><span class="repl-input">(subseq (<a href="#http-request">drakma:http-request</a> "http://www.cl.cam.ac.uk/~mgk25/ucs/examples/digraphs.txt") 0 298)</span>
196 <span class="headers-out">GET /~mgk25/ucs/examples/digraphs.txt HTTP/1.1
197 Host: www.cl.cam.ac.uk
198 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
199 Accept: */*
200 Connection: close
201 </span>
202 <span class="headers-in">HTTP/1.1 200 OK
203 Date: Sun, 09 Dec 2012 08:15:04 GMT
204 Server: Apache/2.2.3 (CentOS)
205 Last-Modified: Mon, 06 Apr 2009 18:13:43 GMT
206 ETag: "17cd62-298-466e6dbcd03c0"
207 Accept-Ranges: bytes
208 Content-Length: 664
209 X-UA-Compatible: IE=edge
210 Connection: close
211 <b>Content-Type: text/plain; charset=utf-8</b>
212 </span>
213 <span class="repl-output">"Latin Digraphs and Ligatures in ISO10646-1
214
215 A short table of ligatures and digraphs follows. Some of these may not be
216 ligatures/digraphs in the technical sense, (for example, æ is a seperate
217 letter in English), but visually they behave that way.
218
219 AÆE : U+00C6
220 aæe : U+00E6
221 ſßs : U+00DF
222 IIJJ : U+0132"</span>
223 </pre>
224
225 <h4 xmlns=""><a name="ex-binary-data">Requesting binary data</a></h4>
226 <p>
227 For non-textual content types, a vector of octets is returned.
228 </p>
229 <pre><span class="repl-output">? </span><span class="repl-input">(<a href="#http-request">drakma:http-request</a> "https://api.github.com/repos/edicl/drakma/git/tags/tag-does-not-exist")</span>
230 <span class="headers-out">GET /repos/edicl/drakma/git/tags/tag-does-not-exist HTTP/1.1
231 Host: api.github.com
232 User-Agent: Drakma/1.3.0 (SBCL 1.1.1.31.master.2-9fac43f-dirty; Darwin; 12.2.0; http://weitz.de/drakma/)
233 Accept: */*
234 Connection: close
235 </span>
236 <span class="headers-in">HTTP/1.1 404 Not Found
237 Server: nginx
238 Date: Fri, 28 Dec 2012 08:37:31 GMT
239 <b>Content-Type: application/json; charset=utf-8</b>
240 Connection: close
241 Status: 404 Not Found
242 X-GitHub-Media-Type: github.beta
243 X-RateLimit-Remaining: 48
244 X-RateLimit-Limit: 60
245 Content-Length: 23
246 X-Content-Type-Options: nosniff
247 Cache-Control:
248 </span>
249 <span class="repl-output">#(123 34 109 101 115 115 97 103 101 34 58 34 78 111 116 32 70 111 117 110 100 34 125)
250 404
251 ((:SERVER . "nginx") (:DATE . "Fri, 28 Dec 2012 08:37:31 GMT") (:CONTENT-TYPE . "application/json; charset=utf-8")
252 (:CONNECTION . "close") (:STATUS . "404 Not Found") (:X-GITHUB-MEDIA-TYPE . "github.beta") (:X-RATELIMIT-REMAINING . "48")
253 (:X-RATELIMIT-LIMIT . "60") (:CONTENT-LENGTH . "23") (:X-CONTENT-TYPE-OPTIONS . "nosniff") (:CACHE-CONTROL . ""))
254 #&lt;PURI:URI https://api.github.com/repos/edicl/drakma/git/tags/tag-does-not-exist&gt;
255 #&lt;FLEXI-STREAMS:FLEXI-IO-STREAM {101C40C043}&gt;
256 T
257 "Not Found"</span>
258 <span class="repl-output">? </span><span class="repl-input">(<a href="http://weitz.de/flexi-streams/#octets-to-string" target="_new">flexi-streams:octets-to-string</a> *)</span>
259 <span class="repl-output">"{\"message\":\"Not Found\"}"</span></pre>
260
261 <h4 xmlns=""><a name="ex-chunked-https">Chunked transfers and HTTPS</a></h4>
262 <p>
263 Request a page using the HTTPS protocol. Also note that the
264 server uses <a name="chunked" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1">chunked
265 transfer encoding</a> for its reply
266 </p>
267 <pre><span class="repl-output">? </span><span class="repl-input">(ql:quickload :cl-ppcre)</span>
268 <span class="repl-output">? </span><span class="repl-input">(cl-ppcre:scan-to-strings "(?s)You have.*your data."
269 (<a href="#http-request">drakma:http-request</a> "https://www.fortify.net/cgi/ssl_2.pl"))</span>
270 <span class="headers-out">GET /cgi/ssl_2.pl HTTP/1.1
271 Host: www.fortify.net
272 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
273 Accept: */*
274 Connection: close
275 </span>
276 <span class="headers-in">HTTP/1.1 200 OK
277 Date: Sun, 09 Dec 2012 08:15:31 GMT
278 Server: Apache
279 Connection: close
280 <b>Transfer-Encoding: chunked</b>
281 Content-Type: text/html
282 </span>
283 <span class="repl-output">"You have connected to this web server using the RC4-SHA encryption cipher
284 with a key length of 128 bits.
285 &lt;p&gt;
286 This is a high-grade encryption connection, regarded by most experts as being suitable
287 for sending or receiving even the most sensitive or valuable information
288 across a network.
289 &lt;p&gt;
290 In a crude analogy, using this cipher is similar to sending or storing your data inside
291 a high quality safe - compared to an export-grade cipher which is similar to using
292 a paper envelope to protect your data."
293 #()</span>
294 </pre>
295
296 <h4 xmlns=""><a name="ex-fake-ua">Faking a user agent header</a></h4>
297 <p>
298 Some servers adapt their behavior according to the Browser
299 that is used. Drakma can claim to be i.e. MS Internet
300 Explorer.
301 </p>
302 <pre><span class="repl-output">? </span><span class="repl-input">(cl-ppcre:scan-to-strings "&lt;h4&gt;.*" (<a href="#http-request">drakma:http-request</a> "http://whatsmyuseragent.com/" <a href="#arg-user-agent">:user-agent :explorer</a>))</span>
303 <span class="headers-out">GET / HTTP/1.1
304 Host: whatsmyuseragent.com
305 <b>User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)</b>
306 Accept: */*
307 Connection: close
308 </span>
309 <span class="headers-in">HTTP/1.1 200 OK
310 Date: Sun, 09 Dec 2012 08:23:50 GMT
311 Server: Apache
312 X-Powered-By: PHP/5.2.17
313 Connection: close
314 Transfer-Encoding: chunked
315 Content-Type: text/html
316 </span>
317 <span class="repl-output">"&lt;h4&gt;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)&lt;/h4&gt;"
318 #()</span>
319 </pre>
320
321 <h4 xmlns=""><a name="ex-post-and-cookie">Posting data and using cookies</a></h4>
322 <p>
323 Drakma can send parameters in a POST request and knows how to
324 deal with <a href="#cookie">cookies</a>. Note how Drakma
325 sends the cookie back in the second request.
326 </p>
327 <pre><span class="repl-output">? </span><span class="repl-input">(let ((cookie-jar (make-instance <a href="#cookie-jar">'drakma:cookie-jar</a>)))
328 (<a href="#http-request">drakma:http-request</a> "http://www.phpsecurepages.com/test/test.php"
329 <a href="#arg-method">:method :post</a>
330 <a href="#arg-parameters">:parameters '(("entered_login" . "test")
331 ("entered_password" . "test"))</a>
332 <a href="#arg-cookie-jar">:cookie-jar cookie-jar</a>)
333 (<a href="#http-request">drakma:http-request</a> "http://www.phpsecurepages.com/test/test2.php"
334 <a href="#arg-cookie-jar">:cookie-jar cookie-jar</a>)
335 (<a href="#cookie-jar-cookies">drakma:cookie-jar-cookies</a> cookie-jar))</span>
336 <span class="headers-out">POST /test/test.php HTTP/1.1
337 Host: www.phpsecurepages.com
338 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
339 Accept: */*
340 Connection: close
341 Content-Type: application/x-www-form-urlencoded
342 Content-Length: 40
343 </span>
344 <span class="headers-in">HTTP/1.1 200 OK
345 Date: Sun, 09 Dec 2012 08:25:13 GMT
346 Server:
347 X-Powered-By: PHP/5.2.17
348 <b>Set-Cookie: PHPSESSID=vijk3706eojs7n8u5cdpi3ju05; path=/</b>
349 Expires: Thu, 19 Nov 1981 08:52:00 GMT
350 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
351 Pragma: no-cache
352 X-Powered-By: PleskLin
353 Content-Length: 4479
354 Connection: close
355 Content-Type: text/html
356 </span>
357 <span class="headers-out">GET /test/test2.php HTTP/1.1
358 Host: www.phpsecurepages.com
359 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
360 Accept: */*
361 <b>Cookie: PHPSESSID=vijk3706eojs7n8u5cdpi3ju05</b>
362 Connection: close
363 </span>
364 <span class="headers-in">HTTP/1.1 200 OK
365 Date: Sun, 09 Dec 2012 08:25:16 GMT
366 Server:
367 X-Powered-By: PHP/5.2.17
368 Expires: Thu, 19 Nov 1981 08:52:00 GMT
369 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
370 Pragma: no-cache
371 X-Powered-By: PleskLin
372 Content-Length: 4479
373 Connection: close
374 Content-Type: text/html
375 </span>
376 <span class="repl-output">(#&lt;COOKIE PHPSESSID=vijk3706eojs7n8u5cdpi3ju05; path=/; domain=www.phpsecurepages.com&gt;)</span>
377 </pre>
378
379 <h4 xmlns=""><a name="ex-reuse-connection">Reusing a connection to a server</a></h4>
380 <p>
381 Drakma can <a name="re-use">use</a> a connection to a server for multiple requests.
382 </p>
383 <pre><span class="repl-output">? </span><span class="repl-input">(let ((stream (nth-value 4 (<a href="#http-request">drakma:http-request</a> "http://www.lispworks.com/" <a href="#arg-close">:close nil</a>))))
384 (nth-value 2 (<a href="#http-request">drakma:http-request</a> "http://www.lispworks.com/success-stories/index.html"
385 <a href="#arg-stream">:stream stream</a>)))</span>
386 <span class="headers-out">GET / HTTP/1.1
387 Host: www.lispworks.com
388 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
389 Accept: */*
390 </span>
391 <span class="headers-in">HTTP/1.1 200 OK
392 Date: Sun, 09 Dec 2012 08:25:56 GMT
393 Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c mod_apreq2-20051231/2.6.0 mod_perl/2.0.5 Perl/v5.8.9
394 Last-Modified: Tue, 20 Nov 2012 12:27:40 GMT
395 ETag: "336280-28eb-4ceec5c1f4700"
396 Accept-Ranges: bytes
397 Content-Length: 10475
398 Content-Type: text/html
399 </span>
400 <span class="headers-out">GET /success-stories/index.html HTTP/1.1
401 Host: www.lispworks.com
402 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
403 Accept: */*
404 <b>Connection: close</b>
405 </span>
406 <span class="headers-in">HTTP/1.1 200 OK
407 Date: Sun, 09 Dec 2012 08:25:56 GMT
408 Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c mod_apreq2-20051231/2.6.0 mod_perl/2.0.5 Perl/v5.8.9
409 Last-Modified: Tue, 20 Nov 2012 12:28:52 GMT
410 ETag: "336386-2940-4ceec6069e900"
411 Accept-Ranges: bytes
412 Content-Length: 10560
413 <b>Connection: close</b>
414 Content-Type: text/html
415 </span>
416 <span class="repl-output">((:DATE . "Sun, 09 Dec 2012 08:25:56 GMT")
417 (:SERVER . "Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c mod_apreq2-20051231/2.6.0 mod_perl/2.0.5 Perl/v5.8.9")
418 (:LAST-MODIFIED . "Tue, 20 Nov 2012 12:28:52 GMT") (:ETAG . "\"336386-2940-4ceec6069e900\"") (:ACCEPT-RANGES . "bytes")
419 (:CONTENT-LENGTH . "10560") (:CONNECTION . "close") (:CONTENT-TYPE . "text/html"))</span>
420 </pre>
421
422 <h4 xmlns=""><a name="ex-basic-auth">Basic Authorization</a></h4>
423 <p>
424 Drakma supports basic authorization. In this example, we use
425 a locally running <a href="http://weitz.de/hunchentoot">Hunchentoot</a> server.
426 </p>
427 <pre><span class="repl-output">? </span><span class="repl-input">(ql:quickload :hunchentoot-test)</span>
428 <span class="repl-output">To load "hunchentoot-test":
429 Load 4 ASDF systems:
430 cl-ppcre cl-who drakma hunchentoot
431 Install 1 Quicklisp release:
432 hunchentoot
433 ...
434 ; Loading "hunchentoot-test"
435
436 (:HUNCHENTOOT-TEST)
437 ? </span><span class="repl-input">(hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 4242))</span>
438 <span class="repl-output">#&lt;EASY-ACCEPTOR (host *, port 4242)&gt;
439 ? </span><span class="repl-input">(nth-value 1 (<a href="#http-request">drakma:http-request</a> "http://localhost:4242/hunchentoot/test/authorization.html"))</span>
440 <span class="headers-out">GET /hunchentoot/test/authorization.html HTTP/1.1
441 Host: localhost:4242
442 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
443 Accept: */*
444 Connection: close
445 </span>
446 <span class="repl-output">127.0.0.1 - [2012-12-09 09:27:40] "GET /hunchentoot/test/authorization.html HTTP/1.1" 401 543 "-" "Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)"</span>
447 <span class="headers-in">HTTP/1.1 <b>401 Authorization Required</b>
448 Content-Length: 543
449 Date: Sun, 09 Dec 2012 08:27:40 GMT
450 Server: Hunchentoot 1.2.5
451 Connection: Close
452 Www-Authenticate: Basic realm="Hunchentoot"
453 Content-Type: text/html; charset=iso-8859-1
454 </span>
455 <span class="repl-output">401
456 ? </span><span class="repl-input">(nth-value 1 (<a href="#http-request">drakma:http-request</a> "http://localhost:4242/hunchentoot/test/authorization.html"
457 <a href="#arg-basic-authorization">:basic-authorization '("nanook" "igloo")</a>))</span>
458 <span class="headers-out">GET /hunchentoot/test/authorization.html HTTP/1.1
459 Host: localhost:4242
460 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
461 <b>Authorization: Basic bmFub29rOmlnbG9v</b>
462 Accept: */*
463 Connection: close
464 </span>
465 <span class="repl-output">127.0.0.1 nanook [2012-12-09 09:28:15] "GET /hunchentoot/test/authorization.html HTTP/1.1" 200 907 "-" "Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)"</span>
466 <span class="headers-in">HTTP/1.1 200 OK
467 Content-Length: 907
468 Date: Sun, 09 Dec 2012 08:28:15 GMT
469 Server: Hunchentoot 1.2.5
470 Connection: Close
471 Content-Type: text/html; charset=utf-8
472 </span>
473 <span class="repl-output">200</span>
474 </pre>
475
476 <h4 xmlns=""><a name="ex-response-stream">Reading the response from a stream</a></h4>
477 <p>
478 Drakma can return a stream to the application so that the
479 reply is not completely buffered in memory first.
480 </p>
481 <pre><span class="repl-output">? </span><span class="repl-input">(let ((stream (<a href="#http-request">drakma:http-request</a> "https://api.github.com/orgs/edicl/public_members"
482 <b>:want-stream t</b>)))
483 (setf (<a href="http://weitz.de/flexi-streams/#flexi-stream-external-format" target="_new">flexi-streams:flexi-stream-external-format</a> stream) :utf-8)
484 (<a href="http://common-lisp.net/project/yason/#parse" target="_new">yason:parse</a> stream :object-as :plist))</span>
485 <span class="headers-out">GET /orgs/edicl/public_members HTTP/1.1
486 Host: api.github.com
487 User-Agent: Drakma/1.3.0 (SBCL 1.1.1.31.master.2-9fac43f-dirty; Darwin; 12.2.0; http://weitz.de/drakma/)
488 Accept: */*
489 Connection: close
490 </span>
491 <span class="headers-in">HTTP/1.1 200 OK
492 Server: nginx
493 Date: Fri, 28 Dec 2012 10:27:34 GMT
494 Content-Type: application/json; charset=utf-8
495 Connection: close
496 Status: 200 OK
497 Last-Modified: Sat, 22 Dec 2012 18:39:14 GMT
498 X-Content-Type-Options: nosniff
499 X-RateLimit-Limit: 60
500 X-GitHub-Media-Type: github.beta
501 Vary: Accept
502 Content-Length: 1899
503 Cache-Control: public, max-age=60, s-maxage=60
504 ETag: "66a5dd35e79146a53029a1807293f9d3"
505 X-RateLimit-Remaining: 56
506 </span>
507 <span class="repl-output">(("type" "User" "repos_url" "https://api.github.com/users/hanshuebner/repos" "followers_url"
508 "https://api.github.com/users/hanshuebner/followers" "login" "hanshuebner" "gists_url"
509 "https://api.github.com/users/hanshuebner/gists{/gist_id}" "following_url"
510 "https://api.github.com/users/hanshuebner/following" "events_url"
511 "https://api.github.com/users/hanshuebner/events{/privacy}" "organizations_url"
512 "https://api.github.com/users/hanshuebner/orgs" "received_events_url"
513 "https://api.github.com/users/hanshuebner/received_events" "url"
514 "https://api.github.com/users/hanshuebner" "avatar_url"
515 "https://secure.gravatar.com/avatar/280d76aa82179ae04550534649de1e6e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
516 "subscriptions_url" "https://api.github.com/users/hanshuebner/subscriptions" "starred_url"
517 "https://api.github.com/users/hanshuebner/starred{/owner}{/repo}" "id" 108751 "gravatar_id"
518 "280d76aa82179ae04550534649de1e6e")
519 ("type" "User" "repos_url" "https://api.github.com/users/nhabedi/repos" "followers_url"
520 "https://api.github.com/users/nhabedi/followers" "login" "nhabedi" "gists_url"
521 "https://api.github.com/users/nhabedi/gists{/gist_id}" "following_url"
522 "https://api.github.com/users/nhabedi/following" "events_url"
523 "https://api.github.com/users/nhabedi/events{/privacy}" "organizations_url"
524 "https://api.github.com/users/nhabedi/orgs" "received_events_url"
525 "https://api.github.com/users/nhabedi/received_events" "url"
526 "https://api.github.com/users/nhabedi" "avatar_url"
527 "https://secure.gravatar.com/avatar/24c09c7b0b2c0481283d854bacdd7926?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
528 "subscriptions_url" "https://api.github.com/users/nhabedi/subscriptions" "starred_url"
529 "https://api.github.com/users/nhabedi/starred{/owner}{/repo}" "id" 537618 "gravatar_id"
530 "24c09c7b0b2c0481283d854bacdd7926"))</span>
531 </pre>
532
533 <h4 xmlns=""><a name="ex-assemble-request-content">Piecemeal assembly of request contents</a></h4>
534 <p>
535 Request contents can be assembled from various sources, and
536 chunked encoding can be used by request bodies. Many servers
537 do not support chunked encoding for request bodies, though.
538 </p>
539 <pre><span class="repl-output">? </span><span class="repl-input">(let ((temp-file (ensure-directories-exist #p"/tmp/quux.txt"))
540 (continuation (<a href="#http-request">drakma:http-request</a> "http://localhost:4242/hunchentoot/test/parameter_latin1_post.html"
541 <a href="#arg-method">:method :post</a>
542 <a href="#arg-content">:content :continuation</a>)))
543 (funcall continuation "foo=" t)
544 (funcall continuation (list (char-code #\z) (char-code #\a)) t)
545 (funcall continuation (lambda (stream)
546 (write-char #\p stream)) t)
547 (with-open-file (out temp-file
548 :direction :output
549 :if-does-not-exist :create
550 :if-exists :supersede)
551 (write-string "p" out))
552 (funcall continuation temp-file t)
553 (cl-ppcre:scan-to-strings "zappzerapp" (funcall continuation "zerapp")))</span>
554 <span class="headers-out">POST /hunchentoot/test/parameter_latin1_post.html HTTP/1.1
555 Host: localhost:4242
556 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
557 Accept: */*
558 Connection: close
559 Content-Type: application/x-www-form-urlencoded
560 <b>Transfer-Encoding: chunked</b>
561 </span>
562 <span class="repl-output">127.0.0.1 - [2012-12-09 10:06:44] "POST /hunchentoot/test/parameter_latin1_post.html HTTP/1.1" 200 1312 "-" "Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)"</span>
563 <span class="headers-in">HTTP/1.1 200 OK
564 Content-Length: 1312
565 Date: Sun, 09 Dec 2012 09:06:44 GMT
566 Server: Hunchentoot 1.2.5
567 Connection: Close
568 Last-Modified: Sun, 09 Dec 2012 09:06:44 GMT
569 Pragma: no-cache
570 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
571 Expires: Mon, 26 Jul 1997 05:00:00 GMT
572 Content-Type: text/html; charset=ISO-8859-1
573 </span>
574 <span class="repl-output">"zappzerapp"
575 #()</span>
576 </pre>
577
578 <h4 xmlns=""><a name="ex-partial-transfers">Partial transfers</a></h4>
579 <p>
580 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35" target="_new">Partial transfers</a> of resources are possible.
581 </p>
582 <pre><span class="repl-output">? </span><span class="repl-input">(cl-ppcre:regex-replace-all
583 "&lt;.*?&gt;"
584 (format nil "~A~%~A"
585 (<a href="#http-request">drakma:http-request</a> "http://members.shaw.ca/mitb/hunchentoot.html"
586 <a href="#arg-range">:range '(998 1034)</a>)
587 (<a href="#http-request">drakma:http-request</a> "http://members.shaw.ca/mitb/hunchentoot.html"
588 <a href="#arg-range">:range '(1213 1249)</a>))
589 "")</span>
590 <span class="headers-out">GET /mitb/hunchentoot.html HTTP/1.1
591 Host: members.shaw.ca
592 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
593 Accept: */*
594 Connection: close
595 <b>Range: bytes=998-1034</b>
596 </span>
597 <span class="headers-in">HTTP/1.1 206 Partial Content
598 Date: Sun, 09 Dec 2012 09:16:16 GMT
599 Server: Apache/2.2.20 (Unix) mod_ldap_userdir/1.1.17
600 Last-Modified: Wed, 14 Mar 2012 23:22:04 GMT
601 ETag: "3b7eed-3238-4bb3c3e453f00"
602 Accept-Ranges: bytes
603 Content-Length: 37
604 <b>Content-Range: bytes 998-1034/12856</b>
605 Content-Type: text/html
606 Connection: close
607 </span>
608 <span class="headers-out">GET /mitb/hunchentoot.html HTTP/1.1
609 Host: members.shaw.ca
610 User-Agent: Drakma/1.3.0 (Clozure Common Lisp Version 1.8-r15286M (DarwinX8664); Darwin; 12.2.0; http://weitz.de/drakma/)
611 Accept: */*
612 Connection: close
613 <b>Range: bytes=1213-1249</b>
614 </span>
615 <span class="headers-in">HTTP/1.1 206 Partial Content
616 Date: Sun, 09 Dec 2012 09:16:16 GMT
617 Server: Apache/2.2.20 (Unix) mod_ldap_userdir/1.1.17
618 Last-Modified: Wed, 14 Mar 2012 23:22:04 GMT
619 ETag: "3b7eed-3238-4bb3c3e453f00"
620 Accept-Ranges: bytes
621 Content-Length: 37
622 <b>Content-Range: bytes 1213-1249/12856</b>
623 Content-Type: text/html
624 </span>
625 <span class="repl-output">"DRAKMA (Queen of Cosmic Greed)
626 HUNCHENTOOT (The Giant Spider)"
627 T</span>
628 </pre>
629
630
631
632 <h3 xmlns=""><a class="none" name="install">Download and Installation</a></h3>
633 <p>
634 Drakma depends on a number of open source libraries, so the
635 preferred method to download, compile and load it is via <a href="http://www.quicklisp.org/">Quicklisp</a>. Drakma's
636 current version number is 2.0.10.
637 </p>
638 <p>
639 The canonical location for the latest version of Drakma is <a href="https://github.com/edicl/drakma/releases">https://github.com/edicl/drakma/releases</a>.
640 </p>
641
642
643 <h3 xmlns=""><a class="none" name="patches">Development and patches</a></h3>
644 <p>
645 The development version of Drakma can be found <a href="https://github.com/edicl/drakma" target="_new">on
646 github</a>. Please use the github issue tracking system to
647 submit bug reports. Patches are welcome, please use <a href="https://github.com/edicl/drakma/pulls">GitHub pull
648 requests</a>. If you want to make a change, please <a href="http://weitz.de/patches.html" target="_new">read this
649 first</a>.
650 </p>
651
652
653 <h3 xmlns=""><a class="none" name="dictionary">The Drakma dictionary</a></h3>
654
655 <h4 xmlns=""><a name="dict-request">Requests</a></h4>
656
657 <p>
658 The <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> function is the heart of
659 Drakma. It is used to send requests to web servers and will
660 either return the message body of the server's reply or (if
661 the user so wishes) a stream one can read from. The wealth of
662 keyword parameters might look a bit intimidating first, but
663 you will rarely need more than two or three of them - the
664 default behavior of Drakma is (hopefully) designed to do The
665 Right Thing[TM] in most cases.
666 </p>
667 <p>
668 You can use the <code xmlns=""><a href="#*header-stream*">*HEADER-STREAM*</a></code> variable
669 to debug requests handled by Drakma in a way similar to <a href="http://livehttpheaders.mozdev.org/">LiveHTTPHeaders</a>.
670 </p>
671
672 <p xmlns=""><a class="none" name="http-request"></a><clix:special-definition xmlns:clix="http://bknr.net/clixdoc">
673 [Function]<br xmlns="http://www.w3.org/1999/xhtml"></br>
674 <b xmlns="http://www.w3.org/1999/xhtml">http-request</b> <i xmlns="http://www.w3.org/1999/xhtml">uri</i><div xmlns="http://www.w3.org/1999/xhtml" class="arglist-spacer">&amp;rest args</div>
675 <div xmlns="http://www.w3.org/1999/xhtml" class="arglist-spacer">&amp;key
676 <a href="#arg-protocol">protocol</a>
677 <a href="#arg-method">method</a>
678 <a href="#arg-force-ssl">force-ssl</a>
679 <a href="#arg-certificate">certificate</a>
680 <a href="#arg-key">key</a>
681 <a href="#arg-certificate-password">certificate-password</a>
682 <a href="#arg-verify">verify</a>
683 <a href="#arg-max-depth">max-depth</a>
684 <a href="#arg-ca-file">ca-file</a>
685 <a href="#arg-ca-directory">ca-directory</a>
686 <a href="#arg-parameters">parameters</a>
687 <a href="#arg-url-encoder">url-encoder</a>
688 <a href="#arg-content">content</a>
689 <a href="#arg-content-type">content-type</a>
690 <a href="#arg-content-length">content-length</a>
691 <a href="#arg-form-data">form-data</a>
692 <a href="#arg-cookie-jar">cookie-jar</a>
693 <a href="#arg-basic-authorization">basic-authorization</a>
694 <a href="#arg-user-agent">user-agent</a>
695 <a href="#arg-accept">accept</a>
696 <a href="#arg-range">range</a>
697 <a href="#arg-proxy">proxy</a>
698 <a href="#arg-proxy-basic-authorization">proxy-basic-authorization</a>
699 <a href="#arg-real-host">real-host</a>
700 <a href="#arg-additional-headers">additional-headers</a>
701 <a href="#arg-redirect">redirect</a>
702 <a href="#arg-auto-referer">auto-referer</a>
703 <a href="#arg-keep-alive">keep-alive</a>
704 <a href="#arg-close">close</a>
705 <a href="#arg-external-format-out">external-format-out</a>
706 <a href="#arg-external-format-in">external-format-in</a>
707 <a href="#arg-force-binary">force-binary</a>
708 <a href="#arg-want-stream">want-stream</a>
709 <a href="#arg-stream">stream</a>
710 <a href="#arg-preserve-uri">preserve-uri</a>
711 <a href="#arg-connection-timeout">connection-timeout</a>
712 <a href="#arg-deadline">deadline</a>
713 </div>
714 <div xmlns="http://www.w3.org/1999/xhtml" class="arglist-spacer">
715 =&gt; body-or-stream<sup>0</sup>, status-code<sup>1</sup>,
716 headers<sup>2</sup>, uri<sup>3</sup>, stream<sup>4</sup>,
717 <a href="#arg-want-stream">must-close<sup>5</sup></a>,
718 reason-phrase<sup>6</sup>
719 </div>
720 </clix:special-definition><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
721 <p xmlns="http://www.w3.org/1999/xhtml">
722 Sends an <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">HTTP</a>
723 request to a web server and returns its reply.
724 <code xmlns=""><i>uri</i></code> is where the request is sent to,
725 and it is either a string denoting a uniform resource
726 identifier or a <code>PURI:URI</code> object. The scheme
727 of <code xmlns=""><i>uri</i></code> must be `http' or `https'.
728 The function returns SEVEN values - the body of the
729 reply<sup>0</sup> (but see below), the status
730 code<sup>1</sup> as an integer, an alist of the
731 headers<sup>2</sup> sent by the server where for each
732 element the car (the name of the header) is a keyword and
733 the cdr (the value of the header) is a string, the
734 uri<sup>3</sup> the reply comes from (which might be
735 different from the <code xmlns=""><i>uri</i></code> the request
736 was sent to in case of redirects), the stream<sup>4</sup>
737 the reply was read from, a generalized boolean<sup>5</sup>
738 which denotes whether the stream should be closed (and
739 which you can usually ignore), and finally the reason
740 phrase<sup>6</sup> from the status line as a string.
741 </p>
742 <p xmlns="http://www.w3.org/1999/xhtml">
743 <a name="arg-protocol"></a>
744 <code xmlns=""><i>protocol</i></code> is the HTTP protocol version
745 which is going to be used in the request line. It must be
746 one of the keywords <code>:HTTP/1.0</code> or
747 <code>:HTTP/1.1</code>.
748 </p>
749 <p xmlns="http://www.w3.org/1999/xhtml">
750 <a name="arg-method"></a>
751 <code xmlns=""><i>method</i></code> is the method used in the
752 request line, a keyword (like <code>:GET</code> or
753 <code>:HEAD</code>) denoting a valid HTTP/1.1 or WebDAV
754 request method, or <code>:REPORT</code>, as described in
755 the Versioning Extensions to WebDAV. Additionally, you
756 can also use the pseudo method <code>:OPTIONS*</code>
757 which is like <code>:OPTIONS</code> but means that an
758 "OPTIONS *" request line will be sent, i.e. the
759 <code xmlns=""><i>uri</i></code>'s path and query parts will be
760 ignored.
761 </p>
762 <p xmlns="http://www.w3.org/1999/xhtml"><a name="arg-force-ssl"></a>
763 If <code xmlns=""><i>force-ssl</i></code> is true, SSL will be
764 attached to the socket stream which connects Drakma with
765 the web server. Usually, you don't have to provide this
766 argument, as SSL will be attached anyway if the scheme of
767 <code xmlns=""><i>uri</i></code> is `https'.
768 </p>
769 <p xmlns="http://www.w3.org/1999/xhtml"><a name="arg-certificate"></a><a name="arg-certificate-password"></a><a name="arg-key"></a>
770 <code xmlns=""><i>certificate</i></code> is the file name of the PEM
771 encoded client certificate to present to the server when
772 making a SSL connection. <code xmlns=""><i>key</i></code> specifies
773 the file name of the PEM encoded private key matching the
774 certificate. <code xmlns=""><i>certificate-password</i></code>
775 specifies the pass phrase to use to decrypt the private key.
776 </p>
777 <p xmlns="http://www.w3.org/1999/xhtml">
778 <a name="arg-verify"></a>
779 <code xmlns=""><i>verify</i></code> can be specified to force
780 verification of the certificate that is presented by the
781 server in an SSL connection. It can be specified either
782 as <code>NIL</code> if no check should be performed,
783 <code>:OPTIONAL</code> to verify the server's certificate
784 if it presented one or <code>:REQUIRED</code> to verify
785 the server's certificate and fail if an invalid or no
786 certificate was presented.
787 </p>
788 <p xmlns="http://www.w3.org/1999/xhtml">
789 <a name="arg-max-depth"></a>
790 <code xmlns=""><i>max-depth</i></code> can be specified to change
791 the maximum allowed certificate signing depth that is
792 accepted. The default is 10.
793 </p>
794 <p xmlns="http://www.w3.org/1999/xhtml">
795 <a name="arg-ca-file"></a>
796 <a name="arg-ca-directory"></a>
797 <code xmlns=""><i>ca-file</i></code> and
798 <code xmlns=""><i>ca-directory</i></code> can be specified to set
799 the certificate authority bundle file or directory to use
800 for certificate validation.
801 </p>
802 <p xmlns="http://www.w3.org/1999/xhtml">
803 The <code xmlns=""><i>certificate</i></code>,
804 <code xmlns=""><i>key</i></code>,
805 <code xmlns=""><i>certificate-password</i></code>,
806 <code xmlns=""><i>verify</i></code>,
807 <code xmlns=""><i>max-depth</i></code>,
808 <code xmlns=""><i>ca-file</i></code> and
809 <code xmlns=""><i>ca-directory</i></code> parameters are ignored
810 for non-SSL requests. They are also ignored on LispWorks.
811 </p>
812 <p xmlns="http://www.w3.org/1999/xhtml">
813 <a name="arg-parameters"></a>
814 <a name="arg-form-data"></a>
815 <code xmlns=""><i>parameters</i></code> is an alist of name/value
816 pairs (the car and the cdr each being a string) which
817 denotes the parameters which are added to the query part
818 of the URL or (in the case of a POST request) comprise the
819 body of the request. (But see
820 <code xmlns=""><i>content</i></code> below.) The values can also
821 be <code>NIL</code> in which case only the name (without
822 an equal sign) is used in the query string. The
823 name/value pairs are URL-encoded using the FLEXI-STREAMS
824 external format <code xmlns=""><i>external-format-out</i></code>
825 before they are sent to the server unless
826 <code xmlns=""><i>form-data</i></code> is true in which case the
827 POST request body is sent as `multipart/form-data' using
828 <code xmlns=""><i>external-format-out</i></code>. The values of
829 the <code xmlns=""><i>parameters</i></code> alist can also be
830 pathnames, open binary input streams, unary functions, or
831 lists where the first element is of one of the former
832 types. These values denote files which should be sent as
833 part of the request body. If files are present in
834 <code xmlns=""><i>parameters</i></code>, the content type of the
835 request is always `multipart/form-data'. If the value is
836 a list, the part of the list behind the first element is
837 treated as a plist which can be used to specify a content
838 type and/or a filename for the file, i.e. such a value
839 could look like, e.g., <tt>(#p"/tmp/my_file.doc"
840 :content-type "application/msword" :filename
841 "upload.doc")</tt>.
842 </p>
843 <p xmlns="http://www.w3.org/1999/xhtml">
844 <a name="arg-url-encoder"></a>
845 <code xmlns=""><i>url-encoder</i></code> specifies a custom URL
846 encoder function which will be used by drakma to
847 URL-encode parameter names and values. It needs to be a
848 function of two arguments. The arguments are the string
849 to encode and the external format to use (as accepted by
850 FLEXI-STREAMS:STRING-TO-OCTETS). The return value must be
851 the URL-encoded string. This can be used if specific
852 encoding rules are required.
853 </p>
854 <p xmlns="http://www.w3.org/1999/xhtml">
855 <a name="arg-content"></a>
856 <a name="arg-external-format-out"></a>
857 <code xmlns=""><i>content</i></code>, if not <code>NIL</code>, is
858 used as the request body - <code xmlns=""><i>parameters</i></code>
859 is ignored in this case. <code xmlns=""><i>content</i></code> can
860 be a string, a sequence of octets, a pathname, an open
861 binary input stream, or a function designator. If
862 <code xmlns=""><i>content</i></code> is a sequence, it will be
863 directly sent to the server (using
864 <code xmlns=""><i>external-format-out</i></code> in the case of
865 strings). If <code xmlns=""><i>content</i></code> is a pathname,
866 the binary contents of the corresponding file will be sent
867 to the server. If <code xmlns=""><i>content</i></code> is a
868 stream, everything that can be read from the stream until
869 EOF will be sent to the server. If
870 <code xmlns=""><i>content</i></code> is a function designator, the
871 corresponding function will be called with one argument,
872 the stream to the server, to which it should send data.
873 </p>
874 <p xmlns="http://www.w3.org/1999/xhtml">
875 Finally, <code xmlns=""><i>content</i></code> can also be the
876 keyword <code>:CONTINUATION</code> in which case
877 <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> returns only one value -
878 a `continuation' function. This function has one required
879 argument and one optional argument. The first argument
880 will be interpreted like <code xmlns=""><i>content</i></code>
881 above (but it cannot be a keyword), i.e. it will be sent
882 to the server according to its type. If the second
883 argument is true, the continuation function can be called
884 again to send more content, if it is <code>NIL</code> the
885 continuation function returns what
886 <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> would have returned.
887 </p>
888 <p xmlns="http://www.w3.org/1999/xhtml">
889 If <code xmlns=""><i>content</i></code> is a sequence, Drakma will
890 use LENGTH to determine its length and will use the result
891 for the `Content-Length' header sent to the server. You
892 can overwrite this with the
893 <code xmlns=""><i>content-length</i></code> parameter (a
894 non-negative integer) which you can also use for the cases
895 where Drakma can't or won't determine the content length
896 itself. You can also explicitly provide a
897 <code xmlns=""><i>content-length</i></code> argument of
898 <code>NIL</code> which will imply that no `Content-Length'
899 header will be sent in any case. If no `Content-Length'
900 header is sent, Drakma will use chunked encoding to send
901 the content body. Note that this will not work with older
902 web servers.
903 </p>
904 <p xmlns="http://www.w3.org/1999/xhtml">
905 <a name="arg-content-length"></a>
906 Providing a true <code xmlns=""><i>content-length</i></code>
907 argument which is not a non-negative integer means that
908 Drakma /must/ build the request body in RAM and compute
909 the content length even if it would have otherwise used
910 chunked encoding, for example in the case of file uploads.
911 </p>
912 <p xmlns="http://www.w3.org/1999/xhtml">
913 <a name="arg-content-type"></a>
914 <code xmlns=""><i>content-type</i></code> is the corresponding
915 `Content-Type' header to be sent and will be ignored
916 unless <code xmlns=""><i>content</i></code> is provided as well.
917 </p>
918 <p xmlns="http://www.w3.org/1999/xhtml">
919 Note that a query already contained in
920 <code xmlns=""><i>uri</i></code> will always be sent with the
921 request line anyway in addition to other parameters sent
922 by Drakma.
923 </p>
924 <p xmlns="http://www.w3.org/1999/xhtml">
925 <a name="arg-cookie-jar"></a>
926 <code xmlns=""><i>cookie-jar</i></code> is a cookie jar containing
927 cookies which will potentially be sent to the server (if
928 the domain matches, if they haven't expired, etc.) - this
929 cookie jar will be modified according to the `Set-Cookie'
930 header(s) sent back by the server.
931 </p>
932 <p xmlns="http://www.w3.org/1999/xhtml">
933 <a name="arg-basic-authorization"></a>
934 <code xmlns=""><i>basic-authorization</i></code>, if not
935 <code>NIL</code>, should be a list of two strings
936 (username and password) which will be sent to the server
937 for basic authorization.
938 </p>
939 <p xmlns="http://www.w3.org/1999/xhtml">
940 <a name="arg-user-agent"></a>
941 <code xmlns=""><i>user-agent</i></code>, if not <code>NIL</code>,
942 denotes which `User-Agent' header will be sent with the
943 request. It can be one of the keywords
944 <code>:DRAKMA</code>, <code>:FIREFOX</code>,
945 <code>:EXPLORER</code>, <code>:OPERA</code>, or
946 <code>:SAFARI</code> which denote the current version of
947 Drakma or, in the latter four cases, a fixed string
948 corresponding to a more or less recent (as of August 2006)
949 version of the corresponding browser. Or it can be a
950 string which is used directly.
951 </p>
952 <p xmlns="http://www.w3.org/1999/xhtml">
953 <a name="arg-accept"></a>
954 <code xmlns=""><i>accept</i></code>, if not <code>NIL</code>,
955 specifies the contents of the `Accept' header sent.
956 </p>
957 <p xmlns="http://www.w3.org/1999/xhtml">
958 <a name="arg-range"></a>
959 <code xmlns=""><i>range</i></code> optionally specifies a subrange
960 of the resource to be requested. It must be specified as
961 a list of two integers which indicate the start and
962 (inclusive) end offset of the requested range, in bytes
963 (i.e. octets).
964 </p>
965 <p xmlns="http://www.w3.org/1999/xhtml">
966 <a name="arg-proxy"></a>
967 <a name="arg-proxy-basic-authorization"></a>
968 If <code xmlns=""><i>proxy</i></code> is not <code>NIL</code>, it
969 should be a string denoting a proxy server through which
970 the request should be sent. Or it can be a list of two
971 values - a string denoting the proxy server and an integer
972 denoting the port to use (which will default to 80
973 otherwise). Defaults to
974 <code xmlns=""><i>*default-http-proxy*</i></code>.
975 <code xmlns=""><i>proxy-basic-authorization</i></code> is used
976 like <code xmlns=""><i>basic-authorization</i></code>, but for the
977 proxy, and only if <code xmlns=""><i>proxy</i></code> is true. If
978 the host portion of the uri is present in the
979 <code xmlns=""><a href="#*no-proxy-domains*">*NO-PROXY-DOMAINS*</a></code> or the
980 <code xmlns=""><i>NO-PROXY-DOMAINS</i></code> list then the proxy
981 setting will be ignored for this request.
982 </p>
983 <p xmlns="http://www.w3.org/1999/xhtml">
984 If <code xmlns=""><i>NO-PROXY-DOMAINS</i></code> is set then it
985 will supersede the <code xmlns=""><a href="#*no-proxy-domains*">*NO-PROXY-DOMAINS*</a></code>
986 variable. Inserting domains into this list will allow them
987 to ignore the proxy setting.
988 </p>
989 <p xmlns="http://www.w3.org/1999/xhtml">
990 <a name="arg-real-host"></a>
991 If <code xmlns=""><i>real-host</i></code> is not <code>NIL</code>,
992 request is sent to the denoted host instead of the
993 <code xmlns=""><i>uri</i></code> host. When specified,
994 <code xmlns=""><i>real-host</i></code> supersedes
995 <code xmlns=""><i>proxy</i></code>.
996 </p>
997 <p xmlns="http://www.w3.org/1999/xhtml">
998 <a name="arg-additional-headers"></a>
999 <code xmlns=""><i>additional-headers</i></code> is a name/value
1000 alist of additional HTTP headers which should be sent with
1001 the request. Unlike in <code xmlns=""><i>parameters</i></code>,
1002 the cdrs can not only be strings but also designators for
1003 unary functions (which should in turn return a string) in
1004 which case the function is called each time the header is
1005 written.
1006 </p>
1007 <p xmlns="http://www.w3.org/1999/xhtml">
1008 <a name="arg-redirect"></a>
1009 <a name="arg-auto-referer"></a>
1010 If <code xmlns=""><i>redirect</i></code> is not <code>NIL</code>,
1011 it must be a non-negative integer or T. If
1012 <code xmlns=""><i>redirect</i></code> is true, Drakma will follow
1013 redirects (return codes 301, 302, 303, or 307) unless
1014 <code xmlns=""><i>redirect</i></code> is 0. If
1015 <code xmlns=""><i>redirect</i></code> is an integer, it will be
1016 decreased by 1 with each redirect. Furthermore, if
1017 <code xmlns=""><i>auto-referer</i></code> is true when following
1018 redirects, Drakma will populate the `Referer' header with
1019 the <code xmlns=""><i>uri</i></code> that triggered the
1020 redirection, overwriting an existing `Referer' header (in
1021 <code xmlns=""><i>additional-headers</i></code>) if necessary.
1022 </p>
1023 <p xmlns="http://www.w3.org/1999/xhtml">
1024 <a name="arg-keep-alive"></a>
1025 <a name="arg-close"></a>
1026 If <code xmlns=""><i>keep-alive</i></code> is T, the server will
1027 be asked to keep the connection alive, i.e. not to close
1028 it after the reply has been sent. (Note that this not
1029 necessary if both the client and the server use HTTP 1.1.)
1030 If <code xmlns=""><i>close</i></code> is T, the server is
1031 explicitly asked to close the connection after the reply
1032 has been sent. <code xmlns=""><i>keep-alive</i></code> and
1033 <code xmlns=""><i>close</i></code> are obviously mutually
1034 exclusive.
1035 </p>
1036 <p xmlns="http://www.w3.org/1999/xhtml">
1037 <a name="arg-external-format-in"></a>
1038 <a name="arg-force-binary"></a>
1039 If the message body sent by the server has a text content
1040 type, Drakma will try to return it as a Lisp string.
1041 It'll first check if the `Content-Type' header denotes an
1042 encoding to be used, or otherwise it will use the
1043 <code xmlns=""><i>external-format-in</i></code> argument. The
1044 body is decoded using FLEXI-STREAMS. If FLEXI-STREAMS
1045 doesn't know the external format, the body is returned as
1046 an array of octets. If the body is empty, Drakma will
1047 return <code>NIL</code>.
1048 </p>
1049 <p xmlns="http://www.w3.org/1999/xhtml">
1050 If the message body doesn't have a text content type or if
1051 <code xmlns=""><i>force-binary</i></code> is true, the body is
1052 always returned as an array of octets.
1053 </p>
1054 <p xmlns="http://www.w3.org/1999/xhtml">
1055 <a name="arg-want-stream"></a>
1056 If <code xmlns=""><i>want-stream</i></code> is true, the message
1057 body is NOT read and instead the (open) socket stream is
1058 returned as the first return value. If the sixth value of
1059 <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> is true, the stream
1060 should be closed (and not be re-used) after the body has
1061 been read. The stream returned is a <a href="http://weitz.de/flexi-streams/">flexi-stream</a>
1062 with a <a href="http://weitz.de/chunga/" target="_new">chunked stream</a> as its underlying stream.
1063 If you want to read binary data from this stream, read
1064 from the underlying stream which you can get with
1065 FLEXI-STREAM-STREAM.
1066 </p>
1067 <p xmlns="http://www.w3.org/1999/xhtml">
1068 <a name="arg-stream"></a>
1069 Drakma will usually create a new socket connection for
1070 each HTTP request. However, you can use the
1071 <code xmlns=""><i>stream</i></code> argument to provide an open
1072 socket stream which should be re-used.
1073 <code xmlns=""><i>stream</i></code> MUST be a stream returned by a
1074 previous invocation of <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code>
1075 where the sixth return value wasn't true. Obviously, it
1076 must also be connected to the correct server and at the
1077 right position (i.e. the message body, if any, must have
1078 been read). Drakma will NEVER attach SSL to a stream
1079 provided as the <code xmlns=""><i>stream</i></code> argument.
1080 </p>
1081 <p xmlns="http://www.w3.org/1999/xhtml">
1082 <a name="arg-connection-timeout"></a>
1083 <code xmlns=""><i>connection-timeout</i></code> is the time (in
1084 seconds) Drakma will wait until it considers an attempt to
1085 connect to a server as a failure. It is supported only on
1086 some platforms (currently abcl, clisp, LispWorks, mcl,
1087 openmcl and sbcl). READ-TIMEOUT and WRITE-TIMEOUT are the
1088 read and write timeouts (in seconds) for the socket stream
1089 to the server. All three timeout arguments can also be
1090 <code>NIL</code> (meaning no timeout), and they don't
1091 apply if an existing stream is re-used. READ-TIMEOUT
1092 argument is only available for LispWorks, WRITE-TIMEOUT is
1093 only available for LispWorks 5.0 or higher.
1094 </p>
1095 <p xmlns="http://www.w3.org/1999/xhtml">
1096 <a name="arg-deadline"></a>
1097 <code xmlns=""><i>deadline</i></code>, a time in the future,
1098 specifies the time until which the request should be
1099 finished. The deadline is specified in internal time
1100 units. If the server fails to respond until that time, a
1101 COMMUNICATION-DEADLINE-EXPIRED condition is signalled.
1102 <code xmlns=""><i>deadline</i></code> is only available on CCL 1.2
1103 and later.
1104 </p>
1105 <p xmlns="http://www.w3.org/1999/xhtml">
1106 <a name="arg-preserve-uri"></a>
1107 If <code xmlns=""><i>preserve-uri</i></code> is not
1108 <code>NIL</code>, the given <code xmlns=""><i>uri</i></code> will
1109 not be processed. This means that the
1110 <code xmlns=""><i>uri</i></code> will be sent as-is to the remote
1111 server and it is the responsibility of the client to make
1112 sure that all parameters are encoded properly. Note that
1113 if this parameter is given, and the request is not a POST
1114 with a content-type of `multipart/form-data',
1115 <code xmlns=""><i>parameters</i></code> will not be used.
1116 </p>
1117 <p xmlns="http://www.w3.org/1999/xhtml">
1118 If <code xmlns=""><i>decode-content</i></code> is not
1119 <code>NIL</code>, then the content will automatically be
1120 decoded according to any encodings specified in the
1121 Content-Encoding header. The actual decoding is done by
1122 the <code xmlns=""><a href="#decode-stream">decode-stream</a></code> generic function,
1123 and you can implement new methods to support additional
1124 encodings. Any encodings in Transfer-Encoding, such as
1125 chunking, are always performed.
1126 </p>
1127 </clix:description></blockquote></p>
1128
1129 <p xmlns=""><a class="none" name="parameter-present-p"></a>
1130 [Function]
1131 <br><b>parameter-present-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name parameters</clix:lambda-list></i>
1132 =&gt;
1133 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">boolean</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1134 <p xmlns="http://www.w3.org/1999/xhtml">
1135 If <code xmlns=""><i>parameters</i></code> is an alist of
1136 parameters as returned by, for example,
1137 READ-TOKENS-AND-PARAMETERS and <code xmlns=""><i>name</i></code>
1138 is a string naming a parameter, this function returns the
1139 full parameter (name and value) - or <code>NIL</code> if
1140 it's not in <code xmlns=""><i>parameters</i></code>.
1141 </p>
1142 </clix:description></blockquote></p>
1143
1144 <p xmlns=""><a class="none" name="parameter-value"></a>
1145 [Function]
1146 <br><b>parameter-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name parameters</clix:lambda-list></i>
1147 =&gt;
1148 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or string null)</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1149 <p xmlns="http://www.w3.org/1999/xhtml">
1150 If <code xmlns=""><i>parameters</i></code> is an alist of
1151 parameters as returned by, for example,
1152 READ-TOKENS-AND-PARAMETERS and <code xmlns=""><i>name</i></code>
1153 is a string naming a parameter, this function returns the
1154 value of this parameter - or <code>NIL</code> if it's not
1155 in <code xmlns=""><i>parameters</i></code>.
1156 </p>
1157 </clix:description></blockquote></p>
1158
1159 <p xmlns=""><a class="none" name="url-encode"></a>
1160 [Function]
1161 <br><b>url-encode</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">string external-format</clix:lambda-list></i>
1162 =&gt;
1163 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1164 <p xmlns="http://www.w3.org/1999/xhtml">
1165 Returns a URL-encoded version of the string
1166 <code xmlns=""><i>string</i></code> using the external format
1167 <code xmlns=""><i>external-format</i></code>.
1168 </p>
1169 </clix:description></blockquote></p>
1170
1171 <p xmlns=""><a class="none" name="decode-stream"></a>
1172 [Function]
1173 <br><b>decode-stream</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">encoding-type stream</clix:lambda-list></i>
1174 =&gt;
1175 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">stream</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1176 <p xmlns="http://www.w3.org/1999/xhtml">
1177 Generic function to decode a stream. This is a generic
1178 function which decodes the stream based on the
1179 encoding-type. If a response contains one or more
1180 transfer or content encodings, then decode-stream is
1181 called for each encoding type in the correct order to
1182 properly decode the stream to its original content.
1183 </p>
1184 <p xmlns="http://www.w3.org/1999/xhtml">
1185 <code xmlns=""><i>encoding-type</i></code> will be a keyword
1186 created by upcasing and interning the encoding type from
1187 the header. <code xmlns=""><i>stream</i></code> will be the
1188 stream that needs to be
1189 decoded. <code xmlns=""><a href="#decode-stream">decode-stream</a></code> returns a new
1190 stream from which you can read the decoded data.
1191 </p>
1192 </clix:description></blockquote></p>
1193
1194 <p xmlns=""><a class="none" name="*body-format-function*"></a>
1195 [Special variable]
1196 <br><b>*body-format-function*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1197 <p xmlns="http://www.w3.org/1999/xhtml">
1198 A function which determines whether the content body
1199 returned by the server is text and should be treated as
1200 such or not. The function is called after the request
1201 <code xmlns=""><a href="#headers">headers</a></code> have been read and it must
1202 accept two arguments, <code><i>headers</i></code> and
1203 <code><i>external-format-in</i></code>, where
1204 <code><i>headers</i></code> is like the third return value
1205 of <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> while
1206 <code><i>external-format-in</i></code> is the
1207 <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> argument of the same
1208 name. It should return <code>NIL</code> if the body
1209 should be regarded as binary content, or a <a href="http://weitz.de/flexi-streams/">FLEXI-STREAMS</a>
1210 external format (which will be used to read the body)
1211 otherwise.
1212 </p>
1213 <p xmlns="http://www.w3.org/1999/xhtml">
1214 This function will only be called if the <a href="#arg-force-binary"><code><i>force-binary</i></code></a>
1215 argument to <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> is
1216 <code>NIL</code>.
1217 </p>
1218 <p xmlns="http://www.w3.org/1999/xhtml">
1219 The initial value of this variable is a function which
1220 uses <code xmlns=""><a href="#*text-content-types*">*TEXT-CONTENT-TYPES*</a></code> to
1221 determine whether the body is text and then proceeds as
1222 described in the <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code>
1223 documentation entry.
1224 </p>
1225 </clix:description></blockquote></p>
1226
1227 <p xmlns=""><a class="none" name="*default-http-proxy*"></a>
1228 [Special variable]
1229 <br><b>*default-http-proxy*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1230 <p xmlns="http://www.w3.org/1999/xhtml">
1231 HTTP proxy to be used as default for the proxy keyword
1232 argument of <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code>. If not
1233 <code>NIL</code>, it should be a string denoting a proxy
1234 server through which the request should be sent. Or it
1235 can be a list of two values - a string denoting the proxy
1236 server and an integer denoting the port to use (which
1237 will default to 80 otherwise).
1238 </p>
1239 </clix:description></blockquote></p>
1240
1241 <p xmlns=""><a class="none" name="*no-proxy-domains*"></a>
1242 [Special variable]
1243 <br><b>*no-proxy-domains*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1244 <p xmlns="http://www.w3.org/1999/xhtml">
1245 A list of domains for which a proxy should not be used.
1246 </p>
1247 </clix:description></blockquote></p>
1248
1249 <p xmlns=""><a class="none" name="*drakma-default-external-format*"></a>
1250 [Special variable]
1251 <br><b>*drakma-default-external-format*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1252 <p xmlns="http://www.w3.org/1999/xhtml">
1253 The default value for the external format keyword
1254 arguments of <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code>. The value
1255 of this variable will be interpreted by <a href="http://weitz.de/flexi-streams/">FLEXI-STREAMS</a>.
1256 The initial value is the keyword <code>:LATIN-1</code>.
1257 (Note that Drakma binds <a href="http://weitz.de/flexi-streams/#*default-eol-style*"><code>*DEFAULT-EOL-STYLE*</code></a>
1258 to <code>:LF</code>).
1259 </p>
1260 </clix:description></blockquote></p>
1261
1262 <p xmlns=""><a class="none" name="*header-stream*"></a>
1263 [Special variable]
1264 <br><b>*header-stream*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1265 <p xmlns="http://www.w3.org/1999/xhtml">
1266 If this variable is not <code>NIL</code>, it should be
1267 bound to a stream to which incoming and outgoing headers
1268 will be written for debugging purposes.
1269 </p>
1270 </clix:description></blockquote></p>
1271
1272 <p xmlns=""><a class="none" name="*text-content-types*"></a>
1273 [Special variable]
1274 <br><b>*text-content-types*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1275 <p xmlns="http://www.w3.org/1999/xhtml">
1276 A list of conses which are used by the default value of
1277 <code xmlns=""><a href="#*body-format-function*">*BODY-FORMAT-FUNCTION*</a></code> to decide
1278 whether a 'Content-Type' header denotes text content. The
1279 car and cdr of each cons should each be a string or
1280 <code>NIL</code>. A content type matches one of these
1281 entries (and thus denotes text) if the type part is <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm"><code>STRING-EQUAL</code></a>
1282 to the car or if the car is <code>NIL</code> and if the
1283 subtype part is <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm"><code>STRING-EQUAL</code></a>
1284 to the cdr or if the cdr is <code>NIL</code>.
1285 </p>
1286 <p xmlns="http://www.w3.org/1999/xhtml">
1287 The initial value of this variable is the list
1288 <pre>(("text" . nil))</pre> which means that every content
1289 type that starts with "text/" is regarded as text, no
1290 matter what the subtype is.
1291 </p>
1292 </clix:description></blockquote></p>
1293
1294
1295
1296 <h4 xmlns=""><a name="headers">Headers</a></h4>
1297 <p>
1298 This section assembles a couple of convenience functions which
1299 can be used to access information returned as the third value
1300 (<code><i>headers</i></code>) of
1301 <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code>.
1302 </p>
1303 <p>
1304 Note that if the server sends <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2">multiple
1305 headers with the same name</a>, these are comprised into one
1306 entry by <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code>. The values are
1307 separated by commas.
1308 </p>
1309
1310 <p xmlns=""><a class="none" name="get-content-type"></a>
1311 [Function]
1312 <br><b>get-content-type</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">headers</clix:lambda-list></i>
1313 =&gt;
1314 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">list</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1315 <p xmlns="http://www.w3.org/1999/xhtml">
1316 Reads and parses a `Content-Type' header and returns it as
1317 three values - the type, the subtype, and an alist
1318 (possibly empty) of name/value pairs for the optional
1319 parameters. <code xmlns=""><i>headers</i></code> is supposed to
1320 be an alist of headers as returned by
1321 <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code>. Returns
1322 <code>NIL</code> if there is no such header amongst
1323 <code xmlns=""><i>headers</i></code>.
1324 </p>
1325 </clix:description></blockquote></p>
1326
1327 <p xmlns=""><a class="none" name="header-value"></a>
1328 [Function]
1329 <br><b>header-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name headers</clix:lambda-list></i>
1330 =&gt;
1331 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or string null)</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1332 <p xmlns="http://www.w3.org/1999/xhtml">
1333 If <code xmlns=""><i>headers</i></code> is an alist of headers as
1334 returned by <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> and
1335 <code xmlns=""><i>name</i></code> is a keyword naming a header,
1336 this function returns the corresponding value of this
1337 header (or <code>NIL</code> if it's not in
1338 <code xmlns=""><i>headers</i></code>).
1339 </p>
1340 </clix:description></blockquote></p>
1341
1342 <p xmlns=""><a class="none" name="read-tokens-and-parameters"></a>
1343 [Function]
1344 <br><b>read-tokens-and-parameters</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">string &amp;key value-required-p</clix:lambda-list></i>
1345 =&gt;
1346 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">list</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1347 <p xmlns="http://www.w3.org/1999/xhtml">
1348 Reads a comma-separated list of tokens from the string
1349 <code xmlns=""><i>string</i></code>. Each token can be followed
1350 by an optional, semicolon-separated list of
1351 attribute/value pairs where the attributes are tokens
1352 followed by a #\= character and a token or a quoted
1353 string. Returned is a list where each element is either a
1354 string (for a simple token) or a cons of a string (the
1355 token) and an alist (the attribute/value pairs). If
1356 <code xmlns=""><i>value-required-p</i></code> is <code>NIL</code>,
1357 the value part (including the #\= character) of each
1358 attribute/value pair is optional.
1359 </p>
1360 </clix:description></blockquote></p>
1361
1362 <p xmlns=""><a class="none" name="split-tokens"></a>
1363 [Function]
1364 <br><b>split-tokens</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">string</clix:lambda-list></i>
1365 =&gt;
1366 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">list</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1367 <p xmlns="http://www.w3.org/1999/xhtml">
1368 Splits the string <code xmlns=""><i>string</i></code> into a list
1369 of substrings separated by commas and optional whitespace.
1370 Empty substrings are ignored.
1371 </p>
1372 </clix:description></blockquote></p>
1373
1374
1375
1376 <h4 xmlns=""><a name="cookies">Cookies</a></h4>
1377 <p>
1378 <code xmlns=""><a href="#http-request">HTTP-REQUEST</a></code> can deal with <a href="http://en.wikipedia.org/wiki/HTTP_cookie">HTTP
1379 cookies</a> if it gets a <a href="#cookie-jar">cookie jar</a>,
1380 a collection of <code xmlns=""><a href="#cookie">COOKIE</a></code> objects, as its <a href="#arg-cookie-jar">cookie-jar</a> argument. Cookies sent
1381 by the web server will be added to the cookie jar (or updated)
1382 if appropriate and cookies already in the cookie jar will be
1383 sent to the server together with the request.
1384 </p>
1385 <p>
1386 Drakma will never remove cookies from a cookie jar
1387 automatically. You have to do it manually using
1388 <code xmlns=""><a href="#delete-old-cookies">DELETE-OLD-COOKIES</a></code>.
1389 </p>
1390
1391 <p xmlns=""><a class="none" name="cookie"></a>
1392 [Standard class]
1393 <br><b>cookie</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1394 <p xmlns="http://www.w3.org/1999/xhtml">
1395 Instances of this class represent <a href="http://en.wikipedia.org/wiki/HTTP_cookie">HTTP
1396 cookies</a>. If you need to create your own cookies, you
1397 should use <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mk_ins.htm"><code>MAKE-INSTANCE</code></a>
1398 with the initargs <code>:NAME</code>, <code>:DOMAIN</code>,
1399 <code>:VALUE</code>, <code>:PATH</code>,
1400 <code>:EXPIRES</code>, <code>:SECUREP</code>, and
1401 <code>:HTTP-ONLY-P</code> all of which are optional except
1402 for the first two. The meaning of these initargs and <a href="#cookie-name">the corresponding accessors</a> should
1403 be pretty clear if one looks at the <a href="http://curl.haxx.se/rfc/cookie_spec.html">original
1404 cookie specification</a> (and at <a href="http://msdn2.microsoft.com/en-us/library/ms533046.aspx">this
1405 page</a> for the <code>HttpOnly</code> extension).
1406 </p>
1407 <pre xmlns="http://www.w3.org/1999/xhtml"><span class="repl-output">? </span><span class="repl-input">(make-instance 'drakma:cookie
1408 :name "Foo"
1409 :value "Bar"
1410 :expires (+ (get-universal-time) 3600)
1411 :domain ".weitz.de")</span>
1412 <span class="repl-output">#&lt;COOKIE Foo=Bar; expires=Sun, 09-12-2012 20:37:42 GMT; path=/; domain=.weitz.de&gt;</span>
1413 </pre>
1414 </clix:description></blockquote></p>
1415
1416 <p xmlns=""><a class="none" name="parse-cookie-date"></a>
1417 [Function]
1418 <br><b>parse-cookie-date</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">string</clix:lambda-list></i>
1419 =&gt;
1420 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">universal-time</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1421 <p xmlns="http://www.w3.org/1999/xhtml">
1422 Parses a cookie expiry date and returns it as a Lisp <a href="http://www.lispworks.com/documentation/HyperSpec/Body/25_adb.htm">universal
1423 time</a>. Currently understands the following formats:
1424 </p>
1425 <pre xmlns="http://www.w3.org/1999/xhtml">"Wed, 06-Feb-2008 21:01:38 GMT"
1426 "Wed, 06-Feb-08 21:01:38 GMT"
1427 "Tue Feb 13 08:00:00 2007 GMT"
1428 "Wednesday, 07-February-2027 08:55:23 GMT"
1429 "Wed, 07-02-2017 10:34:45 GMT"</pre>
1430 <p xmlns="http://www.w3.org/1999/xhtml">
1431 Instead of "GMT" time zone abbreviations like "CEST" and UTC
1432 offsets like "GMT-01:30" are also allowed.
1433 </p>
1434 <p xmlns="http://www.w3.org/1999/xhtml">
1435 While this function has "cookie" in its name, it might
1436 come in handy in other situations as well and it is thus
1437 exported as a convenience function.
1438 </p>
1439 </clix:description></blockquote></p>
1440
1441 <p xmlns=""><a class="none" name="cookie="></a>
1442 [Function]
1443 <br><b>cookie=</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie1 cookie2</clix:lambda-list></i>
1444 =&gt;
1445 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">boolean</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1446 Returns a true value if the cookies
1447 <code><i>cookie1</i></code> and
1448 <code><i>cookie2</i></code> are equal. Two cookies are
1449 considered to be equal if name and path are equal.
1450 </clix:description></blockquote></p>
1451
1452 <p xmlns="">
1453 [Generic accessors]<br><a class="none" name="cookie-name"></a><b>cookie-name</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i>
1454 =&gt;
1455 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string</clix:returns></i><br><tt>(setf (</tt><b>cookie-name</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="cookie-value"></a><b>cookie-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i>
1456 =&gt;
1457 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or string null)</clix:returns></i><br><tt>(setf (</tt><b>cookie-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="cookie-domain"></a><b>cookie-domain</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i>
1458 =&gt;
1459 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string</clix:returns></i><br><tt>(setf (</tt><b>cookie-domain</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="cookie-path"></a><b>cookie-path</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i>
1460 =&gt;
1461 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or string null)</clix:returns></i><br><tt>(setf (</tt><b>cookie-path</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="cookie-expires"></a><b>cookie-expires</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i>
1462 =&gt;
1463 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or integer null)</clix:returns></i><br><tt>(setf (</tt><b>cookie-expires</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="cookie-http-only-p"></a><b>cookie-http-only-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i>
1464 =&gt;
1465 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">boolean</clix:returns></i><br><tt>(setf (</tt><b>cookie-http-only-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="cookie-securep"></a><b>cookie-securep</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i>
1466 =&gt;
1467 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">boolean</clix:returns></i><br><tt>(setf (</tt><b>cookie-securep</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><blockquote></blockquote></p>
1468
1469 <p xmlns=""><a class="none" name="cookie-jar"></a>
1470 [Standard class]
1471 <br><b>cookie-jar</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1472 <p xmlns="http://www.w3.org/1999/xhtml">
1473 An object of this class encapsulates a collection (a list,
1474 actually) of <code>COOKIE</code> objects. You create a new
1475 cookie jar with <code>(MAKE-INSTANCE 'COOKIE-JAR)</code>
1476 where you can optionally provide a list of
1477 <code xmlns=""><a href="#cookie">COOKIE</a></code> objects with the
1478 <code>:COOKIES</code> initarg. The cookies in a cookie jar
1479 are accessed with <code xmlns=""><a href="#cookie-jar-cookies">COOKIE-JAR-COOKIES</a></code>.
1480 </p>
1481 </clix:description></blockquote></p>
1482
1483 <p xmlns="">
1484 [Generic accessors]<br><a class="none" name="cookie-jar-cookies"></a><b>cookie-jar-cookies</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie-jar</clix:lambda-list></i>
1485 =&gt;
1486 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">list</clix:returns></i><br><tt>(setf (</tt><b>cookie-jar-cookies</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie-jar</clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><blockquote></blockquote></p>
1487
1488 <p xmlns=""><a class="none" name="delete-old-cookies"></a>
1489 [Function]
1490 <br><b>delete-old-cookies</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie-jar</clix:lambda-list></i>
1491 =&gt;
1492 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">cookie-jar</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1493 <p xmlns="http://www.w3.org/1999/xhtml">
1494 Removes all cookies from <code xmlns=""><i>cookie-jar</i></code>
1495 which have either expired or which don't have an expiry
1496 date.
1497 </p>
1498 </clix:description></blockquote></p>
1499
1500 <p xmlns=""><a class="none" name="*allow-dotless-cookie-domains-p*"></a>
1501 [Special variable]
1502 <br><b>*allow-dotless-cookie-domains-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1503 <p xmlns="http://www.w3.org/1999/xhtml">
1504 When this variable is not <code>NIL</code>, cookie domains
1505 containing no dots are considered valid. The default is
1506 <code>NIL</code>, meaning to disallow such domains except
1507 for "localhost".
1508 </p>
1509 </clix:description></blockquote></p>
1510
1511 <p xmlns=""><a class="none" name="*ignore-unparseable-cookie-dates-p*"></a>
1512 [Special variable]
1513 <br><b>*ignore-unparseable-cookie-dates-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1514 <p xmlns="http://www.w3.org/1999/xhtml">
1515 Whether Drakma is allowed to treat `Expires' dates in
1516 cookie headers as non-existent if it can't parse them. If
1517 the value of this variable is <code>NIL</code> (which is
1518 the default), an error will be signalled instead.
1519 </p>
1520 </clix:description></blockquote></p>
1521
1522 <p xmlns=""><a class="none" name="*remove-duplicate-cookies-p*"></a>
1523 [Special variable]
1524 <br><b>*remove-duplicate-cookies-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1525 <p xmlns="http://www.w3.org/1999/xhtml">
1526 Determines how duplicate cookies in the response are
1527 handled, defaults to <code>T</code>. Cookies are
1528 considered duplicate using <a href="#cookie="><code>COOKIE=</code></a>.
1529 </p>
1530 <p xmlns="http://www.w3.org/1999/xhtml">
1531 Valid values are:
1532 <ul>
1533 <li><code>NIL</code> - duplicates will not be
1534 removed,</li>
1535 <li><code>T</code> or <code>:KEEP-LAST</code> - for
1536 duplicates, only the last cookie value will be kept,
1537 based on the order of the response header,</li>
1538 <li><code>:KEEP-FIRST</code> - for duplicates, only the
1539 first cookie value will be kept, based on the order of
1540 the response header.</li>
1541 </ul>
1542 </p>
1543 <p xmlns="http://www.w3.org/1999/xhtml">
1544 Misbehaving servers may send duplicate cookies back in the
1545 same <code>Set-Cookie</code> header:
1546 </p>
1547 <pre xmlns="http://www.w3.org/1999/xhtml">HTTP/1.1 200 OK
1548 Server: My-hand-rolled-server
1549 Date: Wed, 07 Apr 2010 15:12:30 GMT
1550 Connection: Close
1551 Content-Type: text/html
1552 Content-Length: 82
1553 Set-Cookie: a=1; Path=/; Secure, a=2; Path=/; Secure
1554 </pre>
1555 <p xmlns="http://www.w3.org/1999/xhtml">
1556 In this case Drakma has to choose whether cookie "a" has
1557 the value "1" or "2". By default, Drakma will choose the
1558 last value specified, in this case "2".
1559 </p>
1560 <p xmlns="http://www.w3.org/1999/xhtml">
1561 By default, Drakma conforms to <a href="http://www.w3.org/Protocols/rfc2109/rfc2109">RFC2109
1562 HTTP State Management Mechanism</a>, section 4.3.3 Cookie
1563 Management:
1564
1565 <blockquote>
1566 <em>
1567 If a user agent receives a Set-Cookie response header
1568 whose NAME is the same as a pre-existing cookie, and
1569 whose Domain and Path attribute values exactly
1570 (string) match those of a pre-existing cookie, the new
1571 cookie supersedes the old.
1572 </em>
1573 </blockquote>
1574 </p>
1575 </clix:description></blockquote></p>
1576
1577
1578 <h4 xmlns=""><a name="conditions">Conditions</a></h4>
1579 <p>
1580 This section lists all the condition types that are defined by
1581 Drakma.
1582 </p>
1583
1584 <p xmlns=""><a class="none" name="cookie-date-parse-error"></a>
1585 [Condition type]
1586 <br><b>cookie-date-parse-error</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1587 <p xmlns="http://www.w3.org/1999/xhtml">
1588 Signalled if Drakma tries to parse the date of an incoming
1589 cookie header and can't interpret it.
1590 </p>
1591 </clix:description></blockquote></p>
1592
1593 <p xmlns=""><a class="none" name="cookie-error"></a>
1594 [Condition type]
1595 <br><b>cookie-error</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1596 <p xmlns="http://www.w3.org/1999/xhtml">
1597 Signalled if someone tries to create a COOKIE object
1598 that's not valid.
1599 </p>
1600 </clix:description></blockquote></p>
1601
1602 <p xmlns=""><a class="none" name="cookie-error-cookie"></a>
1603 [Generic function]
1604 <br><b>cookie-error-cookie</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie-error</clix:lambda-list></i>
1605 =&gt;
1606 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or cookie null)</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1607 <p xmlns="http://www.w3.org/1999/xhtml">
1608 The <code>COOKIE</code> object that caused this error.
1609 Can be <code>NIL</code> in case such an object couldn't be
1610 initialized.
1611 </p>
1612 </clix:description></blockquote></p>
1613
1614 <p xmlns=""><a class="none" name="parameter-error"></a>
1615 [Condition type]
1616 <br><b>parameter-error</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1617 <p xmlns="http://www.w3.org/1999/xhtml">
1618 Signalled if a function was called with inconsistent or
1619 illegal parameters.
1620 </p>
1621 </clix:description></blockquote></p>
1622
1623 <p xmlns=""><a class="none" name="syntax-error"></a>
1624 [Condition type]
1625 <br><b>syntax-error</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1626 <p xmlns="http://www.w3.org/1999/xhtml">
1627 Signalled if Drakma encounters wrong or unknown syntax
1628 when reading the reply from the server.
1629 </p>
1630 </clix:description></blockquote></p>
1631
1632 <p xmlns=""><a class="none" name="drakma-condition"></a>
1633 [Condition type]
1634 <br><b>drakma-condition</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1635 <p xmlns="http://www.w3.org/1999/xhtml">
1636 Superclass for all conditions related to Drakma.
1637 </p>
1638 </clix:description></blockquote></p>
1639
1640 <p xmlns=""><a class="none" name="drakma-error"></a>
1641 [Condition type]
1642 <br><b>drakma-error</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1643 <p xmlns="http://www.w3.org/1999/xhtml">
1644 Superclass for all errors related to Drakma.
1645 </p>
1646 </clix:description></blockquote></p>
1647
1648 <p xmlns=""><a class="none" name="drakma-warning"></a>
1649 [Condition type]
1650 <br><b>drakma-warning</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1651 <p xmlns="http://www.w3.org/1999/xhtml">
1652 Superclass for all warnings related to Drakma.
1653 </p>
1654 </clix:description></blockquote></p>
1655
1656
1657
1658 <h3 xmlns=""><a class="none" name="index">Symbol index</a></h3>
1659 <ul xmlns="">
1660 <li>
1661 <code><a href="#*allow-dotless-cookie-domains-p*">*allow-dotless-cookie-domains-p*</a></code><span class="entry-type">Special variable</span>
1662 </li>
1663 <li>
1664 <code><a href="#*body-format-function*">*body-format-function*</a></code><span class="entry-type">Special variable</span>
1665 </li>
1666 <li>
1667 <code><a href="#*default-http-proxy*">*default-http-proxy*</a></code><span class="entry-type">Special variable</span>
1668 </li>
1669 <li>
1670 <code><a href="#*drakma-default-external-format*">*drakma-default-external-format*</a></code><span class="entry-type">Special variable</span>
1671 </li>
1672 <li>
1673 <code><a href="#*header-stream*">*header-stream*</a></code><span class="entry-type">Special variable</span>
1674 </li>
1675 <li>
1676 <code><a href="#*ignore-unparseable-cookie-dates-p*">*ignore-unparseable-cookie-dates-p*</a></code><span class="entry-type">Special variable</span>
1677 </li>
1678 <li>
1679 <code><a href="#*no-proxy-domains*">*no-proxy-domains*</a></code><span class="entry-type">Special variable</span>
1680 </li>
1681 <li>
1682 <code><a href="#*remove-duplicate-cookies-p*">*remove-duplicate-cookies-p*</a></code><span class="entry-type">Special variable</span>
1683 </li>
1684 <li>
1685 <code><a href="#*text-content-types*">*text-content-types*</a></code><span class="entry-type">Special variable</span>
1686 </li>
1687 <li>
1688 <code><a href="#cookie">cookie</a></code><span class="entry-type">Standard class</span>
1689 </li>
1690 <li>
1691 <code><a href="#cookie-date-parse-error">cookie-date-parse-error</a></code><span class="entry-type">Condition type</span>
1692 </li>
1693 <li>
1694 <code><a href="#cookie-domain">cookie-domain</a></code><span class="entry-type">Generic accessor</span>
1695 </li>
1696 <li>
1697 <code><a href="#cookie-error">cookie-error</a></code><span class="entry-type">Condition type</span>
1698 </li>
1699 <li>
1700 <code><a href="#cookie-error-cookie">cookie-error-cookie</a></code><span class="entry-type">Generic function</span>
1701 </li>
1702 <li>
1703 <code><a href="#cookie-expires">cookie-expires</a></code><span class="entry-type">Generic accessor</span>
1704 </li>
1705 <li>
1706 <code><a href="#cookie-http-only-p">cookie-http-only-p</a></code><span class="entry-type">Generic accessor</span>
1707 </li>
1708 <li>
1709 <code><a href="#cookie-jar">cookie-jar</a></code><span class="entry-type">Standard class</span>
1710 </li>
1711 <li>
1712 <code><a href="#cookie-jar-cookies">cookie-jar-cookies</a></code><span class="entry-type">Generic accessor</span>
1713 </li>
1714 <li>
1715 <code><a href="#cookie-name">cookie-name</a></code><span class="entry-type">Generic accessor</span>
1716 </li>
1717 <li>
1718 <code><a href="#cookie-path">cookie-path</a></code><span class="entry-type">Generic accessor</span>
1719 </li>
1720 <li>
1721 <code><a href="#cookie-securep">cookie-securep</a></code><span class="entry-type">Generic accessor</span>
1722 </li>
1723 <li>
1724 <code><a href="#cookie-value">cookie-value</a></code><span class="entry-type">Generic accessor</span>
1725 </li>
1726 <li>
1727 <code><a href="#cookie=">cookie=</a></code><span class="entry-type">Function</span>
1728 </li>
1729 <li>
1730 <code><a href="#decode-stream">decode-stream</a></code><span class="entry-type">Function</span>
1731 </li>
1732 <li>
1733 <code><a href="#delete-old-cookies">delete-old-cookies</a></code><span class="entry-type">Function</span>
1734 </li>
1735 <li>
1736 <code><a href="#drakma-condition">drakma-condition</a></code><span class="entry-type">Condition type</span>
1737 </li>
1738 <li>
1739 <code><a href="#drakma-error">drakma-error</a></code><span class="entry-type">Condition type</span>
1740 </li>
1741 <li>
1742 <code><a href="#drakma-warning">drakma-warning</a></code><span class="entry-type">Condition type</span>
1743 </li>
1744 <li>
1745 <code><a href="#get-content-type">get-content-type</a></code><span class="entry-type">Function</span>
1746 </li>
1747 <li>
1748 <code><a href="#header-value">header-value</a></code><span class="entry-type">Function</span>
1749 </li>
1750 <li>
1751 <code><a href="#http-request">http-request</a></code><span class="entry-type">Function</span>
1752 </li>
1753 <li>
1754 <code><a href="#parameter-error">parameter-error</a></code><span class="entry-type">Condition type</span>
1755 </li>
1756 <li>
1757 <code><a href="#parameter-present-p">parameter-present-p</a></code><span class="entry-type">Function</span>
1758 </li>
1759 <li>
1760 <code><a href="#parameter-value">parameter-value</a></code><span class="entry-type">Function</span>
1761 </li>
1762 <li>
1763 <code><a href="#parse-cookie-date">parse-cookie-date</a></code><span class="entry-type">Function</span>
1764 </li>
1765 <li>
1766 <code><a href="#read-tokens-and-parameters">read-tokens-and-parameters</a></code><span class="entry-type">Function</span>
1767 </li>
1768 <li>
1769 <code><a href="#split-tokens">split-tokens</a></code><span class="entry-type">Function</span>
1770 </li>
1771 <li>
1772 <code><a href="#syntax-error">syntax-error</a></code><span class="entry-type">Condition type</span>
1773 </li>
1774 <li>
1775 <code><a href="#url-encode">url-encode</a></code><span class="entry-type">Function</span>
1776 </li>
1777 </ul>
1778
1779
1780 </body></html>