TA的每日心情 | 开心 2024-8-31 15:58 |
---|
签到天数: 89 天 [LV.6]常住居民II
管理员
- 积分
- 3366
|
(defun $load-lisp-web$ (ip port file-n lst)
;ip 远程服务器ip地址
;port 远程服务器端口
;file-n 远程服务器上的lisp文件
;lst预留参数
(if (and ip (wcmatch ip "[,http://*,]") file-n) ;"http://127.0.0.1"
(progn
(setq
str
($http-local2$
(list
(cons "IP" ip)
(cons "端口" port)
(cons "http方法" "GET")
(cons "接口" "EmbedFile")
(cons
"报文头"
(list
(cons (strcat "embed_file_path" "staticfiles/" file-n))
)
)
(cons "报文体" "")
(cons "返回格式" nil)
)
)
) ;向exe发送请求,返回的是字符串
(if (or (= str "Bad Request") (= str "400"))
(setq str nil)
)
(if (and str (> (strlen str) 0))
(progn
(al-load-stream
(make-string-input-stream ;如果远程服务器返回的是lisp字串,才需要这个函数,如果远程服务器直接返回的就是流,这个函数可以不要了
str
) ;转换为流
) ;加载流
)
)
)
)
) |
|