(defun webget (host &optional (page "/") (port 80))
(with-open-stream (sock (socket-connect port host :external-format charset:GB18030))
(format sock "GET ~A HTTP/1.0~2%" page)
(loop for line = (read-line sock nil nil) while line
do (format t "~A~%" line))))
(webget "")
阅读(139) | 评论(0) | 转发(0) |