Trivial-HTTP

trivial-http is a trivial networking library for doing HTTP POST and GET (web client operations) over a socket interface. It establishes a package TRIVIAL-HTTP, also called THTTP, from which the following functions are exported:

Trivial-Http is deprecated. See simple-http for minimal, http library.

Check out Drakma for a protocol-conforming, advanced HTTP/1.1 client library all written in lisp.

(THTTP: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.

(THTTP:HTTP-POST URL CONTENT-TYPE CONTENT) - 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.

(THTTP:ESCAPE-URL-QUERY QUERY) - escapes a query string in accordance with the HTTP specification.

Download ASDF package from http://www.unmutual.info/software/trivial-http-1.1.tar.gz

Requires trivial-sockets

A Subversion repository is available over anonymous SVNServe at the following URL:

svn://unmutual.info/trivial-http

For those who'd really quite like to download images, this paste should do it.

I just added support for arbitrary headers. Here is the paste. -- BrianRowe

If trivial-http is insufficient for your intended task, for example, you need to send cookies, see cl-curl for an interface to the libcurl library.

I had to alter the constant +crlf+ to hold (string #\newline) to make things work under Windows and Clisp

I'm not really sure why that would be necessary. Right now trivial-http is sending a raw CR, LF pair; I'm not sure what clisp did to break this. -- Brian Mastenbrook

Uh, you're doing character output, so clisp will have an external format on your character output stream. That external format, on Windows, is likely to convert a #\Newline character to CRLF; I suspect that there is also an identity where #\Newline is #\Linefeed, so Brian's +crlf+ ends up sending out CRLFLF. In Summary: HTTP is a binary protocol. -- Christophe

Web


This page is linked from: ASDF-Install-Tester   Categorized Libraries   cl-curl   cl-yahoo   simple-http   trivial-https   wilbur-web  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively