newlisp可以登录网站并调用网站提供的rest api。本文是调用jenkins提供的rest api,登录需要用户名和密码,而jenkins是采用http basic authentication,对应newlisp代码如下:
(set 'user-passwd "uaername:password")
(set 'basic-auth (append "Authorization: Basic " (base64-enc user-passwd) "\r\n"))
(set 'url "http://localhost:8080/api/json")
(set 'data (get-url url 10000 basic-auth))
(println data)