Making newLISP get-url work with http basic auth

Started by ax0n, January 17, 2009, 09:03:22 AM

Previous topic - Next topic

ax0n

I mentioned http://www.h-i-r.net/2009/01/twitter-followersfriends-from-cli.html">getting newLISP working with twitter in passing on HiR, and it came up to use wget when you need user/password pairs for HTTP Basic Auth. I came up with this to create a working Basic Auth header for get-url.  You must set 'url 'user and 'pass first, obviously.



(set 'hedr (append "Authorization: Basic " (base64-enc (append user ":" pass)) "rnrn"))
(set 'contents (get-url url 5000 hedr))
 


Hopefully, this helps some people. I don't like relying on external programs if I can avoid it.