From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: help with URL module needed Date: Mon, 29 Nov 2004 00:37:39 +0200 Message-ID: <200411290037.39196.pogonyshev@gmx.net> References: <200411261732.12616.pogonyshev@gmx.net> <200411281638.02083.pogonyshev@gmx.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1101681306 21409 80.91.229.6 (28 Nov 2004 22:35:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 28 Nov 2004 22:35:06 +0000 (UTC) Cc: Masatake YAMATO , Thien-Thi Nguyen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 28 23:35:01 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CYXdE-0004nz-00 for ; Sun, 28 Nov 2004 23:35:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYXmb-0004IW-96 for ged-emacs-devel@m.gmane.org; Sun, 28 Nov 2004 17:44:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CYXmS-0004IQ-IW for emacs-devel@gnu.org; Sun, 28 Nov 2004 17:44:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CYXmS-0004IE-4r for emacs-devel@gnu.org; Sun, 28 Nov 2004 17:44:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYXmS-0004IB-2c for emacs-devel@gnu.org; Sun, 28 Nov 2004 17:44:32 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1CYXd2-0000Je-Lv for emacs-devel@gnu.org; Sun, 28 Nov 2004 17:34:48 -0500 Original-Received: (qmail 10485 invoked by uid 65534); 28 Nov 2004 22:34:46 -0000 Original-Received: from unknown (EHLO localhost.localdomain) (195.50.12.120) by mail.gmx.net (mp024) with SMTP; 28 Nov 2004 23:34:46 +0100 X-Authenticated: #16844820 Original-To: Andreas Schwab User-Agent: KMail/1.4.3 In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30462 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30462 Andreas Schwab wrote: > Paul Pogonyshev writes: > > So, I'll ease it. Evaluate these two functions and type > > `M-x wikipedia-login RET': > > > > (defun wikipedia-login () > > (interactive) > > (let ((domain "en") > > =09(url-request-method "POST") > > =09(url-request-extra-headers '(("Content-Type" . > > "application/x-www-form-urlencoded"))) (url-request-data > > =09 (wikipedia-build-post-data '(("wpName" . "Testy Test") > > =09=09=09=09 ("wpLoginattempt" . "Login") > > =09=09=09=09 ("wpPassword" . "test") > > =09=09=09=09 ("wpRetype" . "") > > =09=09=09=09 ("wpEmail" . "")))) > > =09(url-debug=09 t)) > > (url-retrieve (concat "http://" domain > > ".wikipedia.org/w/wiki.phtml?title=3DSpecial:Userlogin&action=3Dsubmi= t") > > (lambda () (pop-to-buffer (current-buffer)))))) > > > > (defun wikipedia-build-post-data (post-data-alist) > > (mapconcat (lambda (association) > > =09 (concat (car association) "=3D" > > =09=09 (url-hexify-string (cdr association)))) > > =09 post-data-alist "&")) > > > > You should get a ``411 Length Required''. > > The problem is that url-http-create-request does not account for the > trailing CRLF in the Content-Length, or rather that it sends the traili= ng > CRLF in the first place. Unfortunately, this doesn't help here (I recompiled Emacs and verified th= at "\r\n" is not appended after POST data anymore.) I still get ``200 OK'' = with invalid password and ``411 Length Required'' with the valid one. Do you mean that you cannot reproduce this? Paul