vindarel / lisp-journey

Discovering the Common Lisp ecosystem. https://lisp-journey.gitlab.io/
2 stars 0 forks source link

blog/new-video-how-to-request-a-web-api-with-common-lisp/ #35

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

New video: how to request a REST API in Common Lisp: fetching the GitHub API 🎥 - Lisp journey

A few weeks ago, I put together a new Lisp video. It’s cool, sound on, ‘til the end ;) I want to show how to (quickly) do practical, real-world stuff in Lisp. Here, how to request a web API. We create a new full-featured project with my project skeleton, we study the GitHub API, and we go ahead.I develop in Emacs with Slime, but in the end we also build a binary, so we have a little application that works on the command line (note that I didn’t use SBCL’s core compression, we could have a lighter binary of around 30MB).

https://lisp-journey.gitlab.io/blog/new-video-how-to-request-a-web-api-with-common-lisp/

aykaramba commented 1 year ago

Thanks for this tutorial, this helps tremendously. I will be taking your lisp course, it looks like the tutorial that I need to take.

As a side point, for any noobs, here is a curl example of how to use token based authentication with the Request Tracker REST api:

curl -H 'Authorization: token 1234-mytokenhere' 'http://10.10.10.10:8000/REST/2.0/queues/all'

And here is how do the same thing using dexador:

(dex:get "http://10.10.10.10:8000/REST/2.0/queues/all"
                  :headers '( ("authorization" . "token 123-mytoken-456") ) 
                  :verbose t)

Other REST interfaces might use the same :headers syntax, I hope it helps.