Lisp Practicals 1

1
2
3
4
5
6
7
8
</p>
<p>;; HTTP Client</p>
<p>(ql:quickload "drakma")</p>
<p>(defvar html (drakma:http-request "https://infoserv.dk"))</p>
<p>; http-request results multiple values<br />(multiple-value-bind (html status headers) (drakma:http-request "https://infoserv.dk")<br />(pprint status))</p>
<p>(defvar result (multiple-value-list (drakma:http-request "https://infoserv.dk")))<br />(defvar headers (nth 2 result))</p>
<p>(pprint headers) <br />(pprint (assoc :link headers)) ; get plist item<br />(pprint (cdr (assoc :link headers))) ; get value of cell</p>
<p>

 

Leave a Reply

Your email address will not be published. Required fields are marked *