POST 先のサーバ、渡すパラメータ (First name, Last name) を入力することができるようになる
(defun http-post (server fname lname)
(interactive "sServer:\nsFirst name:\nsLast name:")
(setq proc (open-network-stream "http-proc" "*http-buffer*" server 80))
(set-process-coding-system proc 'binary 'binary)
(setq content-len
(+ (+ (+ (length "fname=") (length fname)) (length "&lname=")) (length lname)))
(process-send-string
proc
(format (concat
"POST /test.php HTTP/1.0\r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"Content-Length: "
(number-to-string content-len)
"\r\n"
"\r\n"
"fname="
fname
"&lname="
lname))))
0 件のコメント:
コメントを投稿