A very basic Gemini client library for Common Lisp.
Go to file
Jason McBrayer 6bbc17cce1 Work harder to resolve relative URLs on redirects 2023-02-17 14:29:55 -05:00
roswell Write a script for streaming media directly 2021-06-28 13:26:47 -04:00
.gitignore When asked for a stream, return a flexi-stream 2023-01-12 21:47:30 -05:00
LICENSE.md Forgot to add license 2021-03-10 22:02:21 -05:00
README.md Add README 2021-02-17 17:42:11 -05:00
client.lisp Work harder to resolve relative URLs on redirects 2023-02-17 14:29:55 -05:00
gemini-client.asd Normalize IRIs before doing anything else with them 2021-03-31 11:14:42 -04:00
package.lisp Allow a validation callback (for implementing TOFU) 2021-09-29 21:30:16 -04:00

README.md

CL-GEMINI-CLIENT

This is a very basic Gemini client library for Common Lisp. The interface is basically similar to that of the Drakma HTTP library. This isn't a complete client; it includes basically only the networking routines you would build an actual client around, and is intended for use in actual clients and scripts such as feed aggregators.

Usage

CL-USER> (defparameter *my-response* (gemini-client:gemini-request
"gemini://medusae.space"))
*MY-RESPONSE*
CL-USER> (gemini-client:response-status *my-response*)
"20"
CL-USER> (gemini-client:response-meta *my-response*)
"text/gemini"

By default, gemini-request reads the whole response into either a string or a vector of bytes, depending on whether the content-type is text or not. You can pass the keyword argument :want-stream to get a binary stream, instead. Redirects will be automatically followed, with a default limit of 5 redirects. You can pass a client certificate in the :client-certificate keyword argument.